C++ Programming :: Objects and Classes - Discussion
7 / 41
Which of the following class constructor will invoked first?
ABase class
BVirtual base class
CAbstract class
DDerived class
Show Explanation
In general inheritance, the constructor of base class will be invoked first and then the constructor of derived class will be invoked.
In multiple inheritance, base classes constructors are executed in the order of the inheritance and then the derived class constructor is called.
In multilevel inheritance, the constructor of virtual base class will be executed first.
Asked In ::
The order of constructor execution in c++ is depends upon the order of inheritance.
In general inheritance, the constructor of base class will be invoked first and then the constructor of derived class will be invoked.
In multiple inheritance, base classes constructors are executed in the order of the inheritance and then the derived class constructor is called.
In multilevel inheritance, the constructor of virtual base class will be executed first.
Read Full Answer
Report Error
Please Login First Click Here