Summary:
A. variables: (two perspectives)
1. Declare the location angle
Local variables: (method variables) stored on the stack-with the lifecycleCodeBlock is recycled by the system.
Global variables: (class variables) stored on the stack-as the object where it is located is reclaimed
2. Data Type Angle
Value Type: directly store the data itself
Reference Type: storage address -- pointing to an object-object survival on the heap
B. Comparison of the structure and class in the memory (obviously it can be seen as memory allocation)
From this point, we can also see that the storage location of the variable, the value type is stored in the declared place (may be in the heap or stack), and the reference type is stored in the heap.
C. Packing
When value type variable (a) is assigned to reference type variable (B), CLR will copy this value type variable (a) to the stack. At this time (B)
It refers to the copy of the reference on the heap (a). This process is called packing.
Is the Best Presentation:
D. binning
To copy the packed values back, you must display them for type conversion.
Is the Best Presentation:
I would like to make a summary and make more improvements. I hope I can stay in the blog Park for a long time! Thank you for your guidance!