IDNStudy.com, kung saan ang mga eksperto ay sumasagot sa iyong mga tanong. Makakuha ng impormasyon mula sa aming mga eksperto, na nagbibigay ng detalyadong sagot sa lahat ng iyong mga tanong.

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