Java memory can be divided into the stack area, the heap area and the method area.
Stack area: A space that is automatically allocated for continuous allocation, which is used to store local variables defined in the program.
Heap area: A discontinuous memory space used to hold object instance data allocated by the New keyword.
Method Area: The method area is used to store code information for a class, static variables, and constant pools-object type data, and so on.
For example, the instance method is stored in the object instance data, and when we define an object and invoke an instance method of it using that object, the pointer of the method needs to go to the code of the method called in the object type data,
However, the instance method involves the reading and writing of other properties in the calling object, so the virtual opportunity implicitly passes the address of the keynote object to the modulated method when the part code is called, which is implicitly passed to the address
is the this pointer.
Thus, if the this pointer is used in an instance method to invoke the object's properties (such as a), it is clear to which object THIS.A is a, because there may be more than one object of that type.
The this pointer can also do this (parameter) in the first statement of the constructor method; Call, which implements the constructor method call construction method. But this usage requires that the modulated method be constructed in the first
Statement.
Parsing and usage of this in Java