is Keyword C# with Example



is Keyword C# with Example

 	using System;

	class BaseClass{}
	class DerivedClass : BaseClass{}
	
	class isKeywordUsing
	{
		public static void Main()
		{
			BaseClass baseObject = new BaseClass();
			DerivedClass derivedObject = new DerivedClass();
			
			Console.WriteLine("baseObject is BaseClass Type: {0}", baseObject is BaseClass);
			Console.WriteLine("derivedObject is DerivedClass Type: {0}", derivedObject is DerivedClass);
			Console.WriteLine("baseObject is DerivedClass Type: {0}", baseObject is DerivedClass);
			
			Console.WriteLine("\nderivedObject is BaseClass Type: {0}", derivedObject is BaseClass);
			
		}
	}
 

0 Comment's

Comment Form

Submit Comment