A value type is either a struct type or an enumeration type. C# provides a set of predefined struct types called the simple types. The simple types are identified through reserved words, and are further subdivided into numeric types, integral types, and floating point types.
All value types implicitly inherit from class object
. It is not possible for any type to derive from a value type, and value types are thus implicitly sealed.
A variable of a value type always contains a value of that type. Unlike reference types, it is not possible for a value of a value type to be null
or to reference an object of a more derived type.
Assignment to a variable of a value type creates a copy of the value being assigned. This differs from assignment to a variable of a reference type, which copies the reference but not the object identified by the reference.