Recently, I have read the "Understanding .Net" of David Chappell (Chinese ".NET Great View"). I put some important content, I used to have a vague part of some of myself, as a book notes and your own classification summary.
I have repeatedly seen the CTS section (General Type System) (General Type System is Hou Jie's translation, some Taiwan's habits. I personally prefer to translate into general type systems)
1. Reference Type directly inherits from Object; all Value Type directly inherits from ValueType, and the latter inherits from Object.
2, there are three memory allocations in Managed Code:
2.1 Distribute on the Stack managed by the CLR (Value Type): It is usually created when "Creating a Method called" or "Method in a run" is created. Regardless of which, the memory used by the Stack variable will be automatically released when its creator (a Method) is returned.
2.2 Allocated on the HEAP managed by the CLR: Assign the variables assigned to the HEAP, and does not automatically release memory at the end of its creator (a Method). Their memory will be released through the process of garbage collection mechanisms (GARBAGE COLLECTION).
2.3 Assign in separate areas (global variables and static variables)
Note: The above memory assignment refers to the location of the entity of Type, like the entity content (real value) of Reference Type is present in HEAP, but there is also an inlet on the Stack as a reference to the HEAP memory.
3, the following is a few important value Tyoe: Byte, Char, Int16, Int32, Int64, Uint16, Uint32, Uint64, Single, Double, Decimal, Enum (enumeration), Boolean, Structure
4, Structure (Structure) belongs to Value Type. Structures is the biggest difference between classes that the former is Value Type, the latter is Reference Type. We can't inherit anything from Value Type, but you can inherit from Class.
5, the following is a few important reference type: class, interface, arch, string (string), delegate (delegate)