.NET type system
The .NET type system has two different kinds of types namely Value types and
Reference types.
Value types directly contain the data, and instances of value types are either
allocated on the stack or allocated inline in a structure. Value types can be built-in
(implemented by the runtime), user-defined, or enumerations.
The core value types supported by the .NET platform reside within the root of the
System namespace. There types are often referred to as the .NET "Primitive Types".
They include:
·
Boolean
·
Byte
·
Char
·
DateTime
·
Decimal
·
Double
·
Guid
·
Int16
·
Int32
·
Int64
·
SByte
·
Single
·
Timespan
Reference types store a reference to the value's memory address, and are
allocated on the heap. Reference types can be self-describing types, pointer types, or
interface types. The type of a reference type can be determined from values of self-
describing types. Self-describing types are further split into arrays and class types.
Value Type vs. Reference Type