Java Object-Oriented inheritance
Java is single-inheritance, meaning that a class can only inherit from another class (The inherited class is called the parent class [base class], the inherited class is called a subclass), and the inheritance in Java uses the extends keyword.
When a subclass object is generated, Java defaults to calling the parent class's constructor without arguments. The construction method is then executed to generate the object of the parent class. Next, the constructor of the subclass is called, and the object of the child class is generated. [To create an object of a subclass, you first need to generate the object of the parent class, and there is no subclass object without the parent class object.] For example: Without a father, there is no child. ]
Super Keyword: Super represents a reference to a parent class object.
If a subclass uses super () to display a constructor method that calls a parent class, it will look for the constructor that corresponds to super () at execution time without looking for the parent class's constructor without parameters. As with this, super must also be the first execution statement of the constructor method, which cannot be preceded by other executable statements. This is strictly guaranteed to be a parent class object, and then the subclass object is generated.
Java records -12-object-oriented inheritance