#38 – Data Type Hierarchy

All types in .NET inherit from another type, except for System.Object (object), which is at the top of the class hierarchy.

Each type is one of:

  • A built-in type
    • Part of the Common Type System (CTS)
    • Available in C# using a keyword for the type, e.g. int, float, string, array, object
  • A custom type
    • Defined in the .NET Framework class library
  • A user-defined type
    • You define in your code

Here is the class hierarchy for all types.  Indentation indicates that a class derives from class listed above it.  Parentheses indicate C# keywords for built-in types.

  • System.Object  (object)
    • System.ValueType
      • System.Enum
        • user-defined enum types
      • System.Boolean  (bool)
      • System.Byte  (byte)
      • System.SByte  (sbyte)
      • System.Int16  (short)
      • System.UInt16  (ushort)
      • System.Int32  (int)
      • System.UInt32  (uint)
      • System.Int64  (long)
      • System.UInt64  (ulong)
      • System.Single  (float)
      • System.Double  (double)
      • System.Decimal  (decimal)
      • System.Char  (char)
      • System.Void  (void)
      • System.DateTime
      • System.Guid
      • System.TimeSpan
      • System.IntPtr
      • System.UIntPtr
      • user-defined struct types
    • System.String  (string)
    • System.Array  (array)
    • System.Type
    • System.Delegate
      • System.MulticastDelegate  (delegate)
    • custom types in .NET Framework
    • user-defined types
    • boxed value types

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: