Querying Type Information Using the Instance of an Object : Type : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Type »

 

Querying Type Information Using the Instance of an Object









    


using System;
using System.Reflection;
   
class InstanceType
{
  public static void Main()
  {
       String myVar = "a string";
       Type t = myVar.GetType();
       Console.WriteLine("Name : {0}",t.Name);
       Console.WriteLine("Underlying System Type: {0}",t.UnderlyingSystemType);
       Console.WriteLine("Is Class : {0}",t.IsClass);
  }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Type