To practice this and the Super keyword in Java today, I summarize it as follows:
1. Subclass inherits the parent class, the subclass initializes the object, and the parent class constructor method must be called first, since it is possible to use the member variable of the parent class at any time.
The 2.get and set methods only perform assignment of member variables, not initialization.
3. The construction method can not only initialize the member variable, but also assign the value operation.
4. Subclasses use Super If you call the constructor of the parent class (either with or without arguments). Call) to initialize the members of the parent class.
5. If the subclass has two constructor methods, one can call the parent class with the parameter constructor method, and the other can use this (... Call its own parameterless construction method, indirectly call the parent class with the parameter construction method, the parent class does not have to write the non-parametric construction method. This is why the parent class does not implement the initialization of member variables at all without using the parameterless constructor.
This and super keywords in Java