Concept Supplement:
(1) Creating an actual object from a type template, called instantiating the type. An object created by instantiating a type is called an instance of a type object or type . In a C # program, each data item is an instance of some kind.
(2) The data item is the smallest unit discussed in the data structure, and is the most basic and non-divided data unit in the record. A data item can be a combination of letters, numbers, or both. It is described by data type (logical, numeric, character, etc.) and data length. A data item is used to describe a property of an entity .
(3) Types of classification
A. A type such as short, int, and long is called a simple type, and this type can store only one data item .
B. Array types can store multiple data items of the same type . These data items are called array elements. These elements can be referenced by numbers, which are called indexes.
C. There are also some types that can contain many different types of data items . The individual data items in these types are called members, and they have a unique name, unlike using numbers in an array to refer to members. However, there are two types of members in general: data members and function members.
Data member: Holds data related to the object of this class or to a class as a whole.
Function member: Executes code that defines the behavior of the type.
In the previous section we focused on the storage rules for value types and reference types when the data is not members of other types, so how do you store data if it is a member of another type?
1. The data portion of the reference type object is always stored in the heap.
2, Value type objects, or reference types of reference parts can be stored in the heap, or can be stored in the stack, which depends on the actual environment.
So for any object of a reference type, all its data members are stored in the heap, whether they are value types or reference types.
About storage of C # data (bottom)