// internal.
Using System;
class InternalTest { internal int x;
}
class InternalDemo { static void Main() {
InternalTest ob = new InternalTest();
ob.x = 10; // , Console.WriteLine(" ob.x: " + ob.x);
}
}
InternalTest internal. , , , InternalDemo, .
17 ,
I
: , . , . . , . , , .. . #. , , , . . .
(RTTI) . . , , . , , . , .
C# : is, as typeof. .
is
is. :
i s
, , . , , , . , , . i s , , .
is.
// is. using System;
class A {} class : A {}
class Usels {
|
|
static void Main() {
A a = new A();
b = new (); if (a is A)
Console.WriteLine(" A"); if(b is A)
Console.WriteLine ("b , "); if(a is )
Console.WriteLine(" , ");
If(b is )
Console.WriteLine(" "); if(a is object)
Console.WriteLine(" object");
}
}
.
B , b object
i s , . , .
If (b is )
Console.WriteLine("b , ");