When a derived class object is deleted which gets deleted first - the base class object or the derived class object?

Answer

When there is no further use of derived class obect in execution sequence then It gets deleted.

calling of distructor sequence is reverse of constructor calling sequence ,so first derived class obect deleted than base class obect.

 

Improve Answer Discuss the question "When a derived class object is deleted which gets deleted first - the base class object or the derived class object?" Watch Question

First answer by K79mahesh. Last edit by K79mahesh. Contributor trust: 63 [recommend contributor]. Question popularity: 83 [recommend question]


Research your answer:

Can you answer other questions about programming?

Answers.com > Wiki Answers > Categories > Technology > Computers > Computer Programming > When a derived class object is deleted which gets deleted first - the base class object or the derived class object?

Our contributors said this page should be displayed for the questions below. (Where do these come from)
If any of these are not a genuine rephrasing of the question, please help out and edit these alternates.
What is a public class?  Difference between Object and class in C?  When a derived class object is deleted which get s deleted first - the base class object or the derived class object?