Common Type System

The .NET Framework has two kinds of objects: reference types and value types. Figure 2.1 illustrates the type hierarchy within the .NET Framework.

Figure 2.1. Type classification.

From this chart, you can see that all objects derive from either a value type or a reference type. This is a specification of how the object is to be passed around and how it is to be allocated. Value types are copied whenever an object needs to be moved. Value types are allocated from the local stack. Reference types are allocated from a global heap, and only a pointer or reference to the object is passed if the object needs to be used in another method. ...

Get .NET Common Language Runtime Unleashed 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.