«^»
2.3. The Common Type System

Besides providing the functionality normally expected from a runtime system, the CLR also defines a Common Type System (CTS) which must be supported by all .NET languages. The CTS says that each language must provide value types (primitive types, struct types, enumerations) and reference types (class types, interface types, array types, delegate types).

Thai and Lam ([9], p39) say: ‘The CLR provides full support for object-oriented concepts (such as encapsulation, inheritance, and polymorphism) and class features (such as methods, fields, static members, visibility, accessibility, nested types, and so forth). In addition, the CLR supports new features that are nonexistent in many traditional object-oriented programming languages, including properties, indexers and events.’

For efficiency reasons, the CTS has value types as well as reference types. So an int or a value of some struct type will be stored on the stack or inline, whereas an instance of some class type will be stored on the heap (and pointed to by some variable). However, any value (that is of some value type) can automatically be wrapped into an object by a process known as boxing. So a value (of some value type) can be used in contexts where an object is expected:

tArrayList.Add(27);