24.2. Primitive-Type Structures; Boxing and Unboxing

The data structures we discuss in this chapter store Object references. As you’ll soon see, these data structures can store both primitive- and reference-type values. This section discusses the mechanisms that enable primitive-type values to be manipulated as objects.

Primitive-Type Structures

Each primitive type (Appendix L, Primitive Types) has a corresponding Structure in namespace System that declares the primitive type. These Structures are called Boolean Byte SByte Char Decimal Double Single Int16 UInt16 Int32 UInt32 Int64 and UInt64. Types declared with keyword Structure are implicitly value types.

Primitive types are actually aliases for their corresponding Structures, so a variable ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.