Suppose class Child is derived from class Parent that was in turn derived from class GrandParent. When we destroy an object of class Child, three destructors are called: i) Child, ii) Parent, iii )GrandParent.. What is the order?

a. Child, Parent, GrandParent
b. Parent, GrandParent, Child
c. GrandParent, Child, Parent
d. GrandParent, Parent, Child
e. GrandParent, Child, Parent


a) In an inheritance chain, destructors are called in reverse order that then constructor were called. The object’s class destructor is called first, then the constructor of the first class up the inheritance chain, and so on to the ultimate base class.

Computer Science & Information Technology

You might also like to view...

Java programs communicate with databases using what API?

a. DBMS. b. JDBC. c. RDBMS. d. Database.

Computer Science & Information Technology

When creating a webpage using HTML, you can vary the formatting of text

Indicate whether the statement is true or false

Computer Science & Information Technology

A shortcut menu displays

A) context-sensitive commands. B) option buttons. C) a library. D) a theme.

Computer Science & Information Technology

Custom properties are a collection of properties that you can choose from to supplement the general database property categories included in the property sheet. ____________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology