Mono Class Library: System NamespaceSystem.ValueType Class |
See Also: ValueType Members
|
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
Note:[Edit]Data types are separated into value types and reference types. Value types are either stack-allocated or allocated inline in a structure. Reference types are heap-allocated. Both reference and value types are derived from the ultimate base class object. In cases where a value type needs to act like an object, a wrapper that makes the value type look like a reference object is allocated on the heap, and the value type's value is copied into it. The wrapper is marked so that the system knows that it contains a value type. This process is known as boxing, and the reverse process is known as unboxing. Boxing and unboxing allow any type to be treated as an object.
In the following example, the number 3 is boxed as a int, and int.ToString () is called.
C# Example using System; class Boxer { public static void Main() { Console.WriteLine("Value is {0}.", 3.ToString()); } }The output is
Value is 3.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0