The running result of the above code:
1). First look at the third line:
Person P01 = new person ();
The left side of the equals sign creates a variable "P01" of Class "person" (Creates a "P01" in the Memory stack space):
The right side of the equals sign creates an area in the heap space to hold the "P01" and passes the address to "P01":
The initial value of the member variable in the current class is the default value: 1. The default value for the Byte/short/long/int type is "0"; 2. The default value for char type is "space";
The default value for the 3.boolean type is "false"; 4. The default value for a reference type is "null";
2). So the fourth to fifth line of code output is the default value
3). Line sixth outputs the address of the P01 object.
4). Line seventh through line nineth to assign values to three member variables
5). line 12th through 13th output new assignment Age name gender
6). Line 14th outputs the same address as the sixth line, stating that the address does not change with the assignment
Stored procedures in memory for Java member variables