An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
reference types are allocated on the heap, value types are typically allocated on the stack, but boxing (cast as object) will allocate on the heap. if a class instance contains a value type, its allocated with the instance heap allocation in-place not separately. a class instance with a reference type (say a string), the pointer is in the instance allocation, and the the string instance is a separate heap allocation.
to better understand, if a variable is a value type, the variable references the actual value, which if a local variable is allocated on the stack. a static value type variable is allocated in the compile data space. reference type variables are a pointer to the object instance. again if a local variable, the pointer is allocated on the stack, if static the compiled data space.
at the compiler level, a local variable is a stack pointer address plus an offset. if the variable is a value type the computed address contains the value, if a reference type, its the pointer to the object instance.