Export (0) Print
Expand All
6 out of 6 rated this helpful - Rate this topic

ValueType Class

Provides the base class for value types.

For a list of all members of this type, see ValueType Members.

System.Object
   System.ValueType
      Derived classes

[Visual Basic]
<Serializable>
MustInherit Public Class ValueType
[C#]
[Serializable]
public abstract class ValueType
[C++]
[Serializable]
public __gc __abstract class ValueType
[JScript]
public
   Serializable
abstract class ValueType

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

ValueType overrides the virtual methods from Object with more appropriate implementations for value types. See also Enum, which inherits from ValueType.

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 it is necessary for a value type to behave 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 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.

Requirements

Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

ValueType Members | System Namespace | Object | Enum

Show:
© 2014 Microsoft. All rights reserved.