Elements of the CLR Type System

Figure 2.2 depicts the basic CLR type system. The type system is logically divided into two subsystems, value types and reference types.

Figure 2.2. The CLR type system

A value type consists of a sequence of bits in memory, such as a 32-bit integer. Any two 32-bit integers are considered equal if they hold the same number—that is, if the sequence of bits is identical.

Reference types combine the address of a value (known as its identity) and the value's sequence of bits. Reference types can, therefore, be compared using both identity and equality. Identity means that two references refer to the same object; equality ...

Get Programming in the .NET Environment 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.