Inheritance - Programming

Q1:

Assume class B is inherited from class A. Which of the following statements is correct about construction of an object of class B?

A While creating the object firstly the constructor of class B will be called followed by constructor of class A.

B While creating the object firstly the constructor of class A will be called followed by constructor of class B.

C The constructor of only class B will be called.

D The constructor of only class A will be called.

E The order of calling constructors depends upon whether constructors in class A and class B are private or public.

ANS:B - While creating the object firstly the constructor of class A will be called followed by constructor of class B.

No answer description is available. Let's discuss.