is Operator for C# .Net interfaces - C# :

Started by sukishan, Jul 11, 2009, 02:51 PM

Previous topic - Next topic

sukishan

is Operator for C# .Net interfaces - C# :
  A new C# operator that can be used to define that class should be explained. It is the is operator. Look at the following piece of code:

if(nodeC is INode)
     Console.WriteLine("nodeC is object of INode type");
else
     Console.WriteLine("nodeC isn't object of INode type");


   In example nodeC object was created as ClonableNode type, but when we run program "if operator" returns true. It means that nodeC also is of INode type. 
A good beginning makes a good ending