In inheritance, the subclass object must call the constructor in the parent class before instantiating, and then call its own constructor.
sample program
Example program for subclass object instantiation. When a subclass object is instantiated, it will first call the constructor of the parent class, and then call its own constructor. So when instantiating a subclass object, you need to initialize the properties of the parent class first.