If there are 5 classes, E is derived from D, D from C, C from B and B from

If there are 5 classes, E is derived from D, D from C, C from B and B from A. Which class constructor will be called first if the object of E or D is created?
A. A
B. B
C. C
D. A and B
 
Answer: a
Explanation: A is parent of all other classes indirectly. Since A is parent of B and B is parent of C and so on till E. Class A constructor will be called first always.
 

Tìm kiếm

Back
Top