|
The "is" operator allows you to check whether an object is compatible with a specific type. For example to check whether a variable is compatible with object type - int i = 10;
if(i is object)
{
Console.WriteLine("i is an object");
}
int, like all C# data types, inherits from object class; therefore the expresion "i is object" evaluates to true.
|