Type.BaseType : Type « System « C# / C Sharp by API






Type.BaseType

    

using System;

class MainClass
{
  static void Main(string[] args)
  {
    Object cls1 = new Object();
    System.String cls2 = "Test String" ;

    Type type1 = cls1.GetType();
    Type type2 = cls2.GetType();

    // Object class output
    Console.WriteLine(type1.BaseType);
    Console.WriteLine(type1.Name);
    Console.WriteLine(type1.FullName);
    Console.WriteLine(type1.Namespace);

    // string output
    Console.WriteLine(type2.BaseType);
    Console.WriteLine(type2.Name);
    Console.WriteLine(type2.FullName);
    Console.WriteLine(type2.Namespace);
  } 
}

   
    
    
    
  








Related examples in the same category

1.Type.ContainsGenericParameters
2.Type.FullName
3.Type.GetConstructor
4.Type.GetCustomAttributes
5.Type.GetEvents()
6.Type.GetFields()
7.Type.GetGenericArguments()
8.Type.GetGenericTypeDefinition()
9.Type.GetInterfaces()
10.Type.GetMethod(String methodName);
11.Type.GetMethods()
12.Type.GetProperties()
13.Type.GetType(String typeName)
14.Type.GetType(String typeName, true)
15.Type.GetType(String typeName, true, true);
16.Type.IsAbstract
17.Type.IsClass
18.Type.IsCOMObject
19.Type.IsEnum
20.Type.IsGenericTypeDefinition
21.Type.IsSealed
22.Type.MakeGenericType
23.Type.Name
24.Type.ReflectionOnlyGetType
25.Type.UnderlyingSystemType