Use super to operate hidden member variables and methods
Once a subclass hides an inherited member variable, the object created by the subclass will no longer own the variable. The variable will be owned by the keyword super. Similarly, once the subclass hides the inherited method, then the object created by the subclass will Hidden methods cannot be called. The calling of this method is handled by the keyword super. Therefore, if you want to use member variables or methods hidden by the subclass in a subclass, you need to use the keyword super.
Notice:
When super calls a hidden method, the member variables that appear in the method are member variables hidden by the subclass or inherited member variables.
Use super to call the constructor of the parent class
When using the constructor of a subclass to create an object of the subclass, the constructor of the subclass always first calls a constructor of the parent class. That is, if the constructor of the subclass does not explicitly indicate the use of the constructor of the parent class, Which constructor method, the subclass calls the parent class's constructor without parameters.
Since the subclass does not inherit the construction method of the parent class, the subclass needs to use super in its construction method to call the construction method of the parent class, and super must be the first statement in the construction method of the subclass, that is, if in the subclass In the constructor method, if the super keyword is not explicitly written to call a certain constructor method of the parent class, then the default is:
super();