When I inherit Base class into Derived class, and I create object for Derived class, then will it internally create object for Base class ?
we can't really predict
It actually creates object for Derived class only, but into derived class it will create the instance variables of Base class and then calls Base class constructor to initialize the base class instance variables. After that it will call Derived class constructor to initialize the instance variables of Derived class.
Back To Top