How to construct the parent and child classes:
If there is a default parameterless constructor in the parent class, calls are made automatically in the constructor of the child class. If the parent class has its own constructor, and the parent does not have a default parameterless constructor, then in the constructor of the subclass, you must call a constructor of the parent class, and it must be called in the first statement of the constructed method, in the form super () If placed in another place can not reflect the function of the constructor, the program error.
"If there is no such constraint, then a method of the subclass that inherits from the parent class may use some of the variables in the parent class, and those variables are not initialized to produce some unpredictable consequences, so the object of the subclass must be constructed and hidden in the subclass object before the object of the child class is constructed. Use the keyword super to refer to the parent class object. ”
Java practice-Interface and inheritance