Discussion :: C++ - MCQs
- Pick out the correct statement.
A.
A derived class's constructor cannot explicitly invokes its base class's constructor.
|
B.
A derived class's destructor cannot invoke its base class's destructor.
|
C.
A derived class's destructor can invoke its base class's destructor.
|
D.
None of the mentioned
|
Answer : Option B
Explanation :
Destructors are automatically invoked when a object goes out of scope or when a dynamically allocated object is deleted. Inheritance does not change this behavior. This is the reason a derived destructor cannot invoke its base class destructor.
Be The First To Comment