Before speaking, some basic knowledge should be available: 1. if no constructor is defined in a class, the compiler automatically adds the default non-argument constructor during compilation: [java] public ClassName {} 2. the difference between this and super. 3. Each class is directly or indirectly a subclass of the Object. The Object has only one construction method without parameters. 4. the compiler will implicitly Add the default no-argument constructor of the parent class in the first line of each constructor, that is, add super (). Easy for beginners: [java] class Employee extends Object {public Employee (int id) {}} class Teacher extends Employee {public Teacher () the above code will produce a compilation error: [plain] Implicit super constructor Employee () is undefined. must explicitly invoke another constructor because the parent class defines a constructor with parameters, the compiler does not add a default non-argument constructor, however, because the constructor of the subclass does not explicitly call a constructor of the parent class, the compiler automatically adds the super () method, but the parent class does not have any default constructor, therefore, the system will prompt that the default construction method without parameters is undefined. The modified code: [java] class Employee {public Employee (int id) {}} class Teacher extends Employee {public Teacher () {super (10, A constructor of the parent class is explicitly called in the constructor of the subclass, so the compiler does not automatically add the super () method. Access modifier of constructor: it can be modified by public, protected, default, and private. However, for private, subclass cannot call the constructor of this class. Multi-level calling of the parent class constructor: Suppose we have such a hierarchy: Object-> Employee-> Teacher-> aggregsor [java] class Employee {public Employee () {System. out. println ("Employee constructor called") ;}} class Teacher extends Employee {public Teacher () {System. out. println ("Teacher constructor called") ;}} class extends sor extends Teacher {public extends sor () {System. out. println ("extends sor constructor called") ;}} public class Test {p Ublic static void main (String args []) {Employee p = new worker sor () ;}} print the result: [plain] Employee constructor called Teacher constructor called pointer sor constructor called when creating the pointer sor object (new pointer sor (), the class's no-argument constructor is first found, and then super () is first called () method: Call the non-parameter constructor of the Teacher Class, call the non-parameter constructor of the Employee, and call the non-parameter constructor of the Object. Finally, print the information again.