The previous summary: JVM memory space is divided into three blocks, namely method area, heap area, and stack area
The method area contains: class files, static variables
The heap area contains: objects, instance variables in objects
The stack area contains: methods, local variables in methods
The method area first has data. The garbage collector focuses on the heap area (when there is no reference to it), the stack area is the most active, how to set the memory space and its application, and some technical points of the method, stack area, and heap area. Master these Skills, as well as strengthening the knowledge of various java technologies, I will analyze it for everyone.
Encapsulation: The main purpose is to simplify complex problems and encapsulate complex structures, leaving only simple operation entrances
Second, safety and portability
Realization: Property privatization, and set and get methods are provided, and security control can be performed in set.
…
===================================================================================
day10-class notes
1. This keyword
[Customer]
[Understanding: Since the object is not unique and dynamic, the instance method does not need the static keyword]
[This above can be omitted (in most cases)]
[CustomerTest]
[this cannot be used in a method with static, combined with the above 4 rules totaling 6]
[How to access instance variables in Static? Create an object! 】
【In the class body directly define the instance variable, between the main method and the method body is the member variable, and define the local variable in the method body, to be determined】
【ThisTest】
【this final conclusion】
【this cannot be omitted Circumstances]
[Generate a parameter-free construction method]
[Choose parameters in the pop-up window]
[this is used in a parameter-free construction method to call a parameter-based construction method]
[Where can this be used]
[Homework]
[Put the last part above to the top, as follows]
Learn Java with zero foundation, I recommend joining my ten-year Java learning field .