The subclass constructor calls the parameterless constructor of the parent class by default, and if the parent class does not have a parameterless constructor, it is necessary to explicitly call the parent class's other constructors in the first row of the child-class constructor.
Second, from the perspective of inheritance, you inherit a class, which is equivalent to extending a class to form a more special class, but often we need to turn the subclass upward into a base class for use or for various other purposes.
At this point, if you do not invoke the constructor of the parent class when you generate the subclass object, we will report the variable uninitialized error when we use some of the member variables of the parent class. keep in mind that variable initialization is always done before the constructor calls!
Constructs an object that first calls its constructor method to initialize its member functions and member variables. A subclass has member variables and member methods of the parent, and if not called, the member variables and member methods inherited from the parent class are not properly initialized.
Why do I need to call the constructor of the parent class when I create a new subclass