Here we will mention initialization. The reference is not provided with the default object, and its value is null.
The base class object is encapsulated in the derived class object.
Therefore, the safest way to use Java is to first call the baseclass constructor in the derivedclass constructor.
The upward transformation mechanism also shows that after inheritance, the new class is a form of the old class.
Final keywords:
When it acts on the reference, it modifies the reference itself, so that it will end up with an object.
Maybe you want to change the corresponding object to final. Unfortunately, Java does not provide this mechanism.
In addition, the final method will not be rewritten in derived class.
You can overwrite a private function that will not be inherited,
In fact, what you do is to define a new function, because there is no function with the same name in the interface.
Finally, I would like to give a piece of advice: Oop should first consider combination and use inheritance only when necessary.