After learning the basics this week, we entered a new stage of learning and learned more about new knowledge. To make a summary.
Private provides us with the concept of encapsulation, and provides the public method for us to access and modify methods and properties, so that not only can restrict the modification of certain properties of access, but also the internal layer of the property method of a certain split assembly to achieve a cryptographic effect. Encapsulation is a broad concept, and it is also called a wrapper to write the methods and properties in the same class.
Statically modified methods and member variables we call static member variables, which are characterized by the existence of a data region, and all objects share a copy, if an object call changes its value, the other object call value is also changed values; static loads with the load of the class, which takes precedence over the existence of the object. Therefore, the This keyword cannot be used in its methods because it can only access static members.
The static initialization block is also the same, loaded as the class is loaded, used to initialize the class, and is called only once, and the new object is no longer called.
Instantiating an initialization block is different, it is executed once every time the object of the class is instantiated, and it executes before the constructor call.
In addition, we have learned the concept of an inner class, which is a redefinition of the class within the class. There are four types of Java internal classes: Static inner class, member inner class, local inner class, anonymous inner class. In order to write the Java code beautifully refined, we must learn the use of internal classes, at present we only require the mastery of naming norms, and know what it is a kind of internal class, concrete later strengthening.
Knowledge Point Grooming