👤

Why creating an object of the sub class also invokes the constructor of the super class


Sagot :

Answer:

Why creating an object of the sub class invokes also the constructor of the super class? When inheriting from another class, super() has to be called first in the constructor. If not, the compiler will insert that call. This is why super constructor is also invoked when a Sub object is created.

Explanation:

#Carry on learning