Object Obj=new object ();
A very simple code, but here is the design of the Java stack, Java heap, Java method to the three most important memory area between the association.
Suppose this code appears in the method body.
1.Object obj will be reflected in the local variable table of the Java stack, which is the definition of a local variable. is a reference type.
The 2.new Object () will be reflected in the Java heap. All instance data values for the object type are stored (the secondary memory is not fixed, because no one can determine the size of the object).
3. The program runs, the type information has been loaded into memory, the data is in the Java method area, including: type of the parent type, the implementation of the interface, the method contains the type information. New Object (), which establishes the object based on this information. You can see that this information is thread-shared.
The memory reference of Object Obj=new object ()