is operator tells if a reference is a certain class.
using System;
class Person
{
public string name;
}
class Employee : Person
{
public string companyName;
}
class Program
{
static void Main(string[] args)
{
Person p = new Employee();
Console.WriteLine(p is Employee);
}
}
The output:
True
| w__w___w___.___j___a_v_a__2__s___.___c___o__m__ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |