rakesh kankavlikar wrote:
I have a question that whenever I create the object of the derived class the constructor of superclass gets called.
I mean to say a constructor is called only when the object is created does that mean that whenever I create derievd class Object superclass Object also gets created.
Your Sub class Constructor calls "super()"[it calls your Super Classe's default Constructor] in his first line implicitly. please Avoid the term of "derived class " . it is not C++
rakesh kankavlikar wrote:
Further I want to ask instance method is called only when object exists but I can call the superclass instance method
from the subclass method which I have overridden in subclass. without creating the superclass object.
How?
that is what IS-A relationship is