Share via


IsValueType Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a value indicating whether the Type is a value type.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public ReadOnly Property IsValueType As Boolean
public bool IsValueType { get; }
public:
property bool IsValueType {
    bool get ();
}
member IsValueType : bool with get
function get IsValueType () : boolean

Property Value

Type: System. . :: . .Boolean
true if the Type is a value type; otherwise, false.

Remarks

Value types are types that are represented as sequences of bits; value types are not classes or interfaces. Value types are referred to as "structs" in some programming languages. Enums are a special case of value types.

This property returns false for the ValueType class, because ValueType is not a value type itself. It is the base class for all value types, and therefore any value type can be assigned to it. This would not be possible if ValueType itself was a value type. Value types are boxed when they are assigned to a field of type ValueType.

This property returns true for enumerations, but not for the Enum type itself. For an example that demonstrates this behavior, see IsEnum.

.NET Framework Security

See Also

Reference

Type Class

System Namespace