Demonstrate typeof : Typeof : Operator C# Examples


C# Examples » Operator » Typeof »

 

Demonstrate typeof









    
using  System;  
using  System.IO;  
  
class  MainClass  {  
    public  static  void  Main()  {  
        Type  t  =  typeof(StreamReader);  
  
        Console.WriteLine(t.FullName);          
  
        if(t.IsClass)  
                  Console.WriteLine("Is  a  class.");  
        if(t.IsAbstract)  
                  Console.WriteLine("Is  abstract.");  
        else  
                  Console.WriteLine("Is  concrete.");  
  
    }  
}
    
   
  
   



Output

System.IO.StreamReader
Is a class.
Is concrete.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Typeof