← Quiz: Inheritance and Virtual Functions: all 10 questions
Quiz: Inheritance and Virtual Functions · Question 3 of 10
In what order do constructors run for a Derived object?
In what order do constructors run for a Derived object?
- A.Base first, then Derived
- B.Derived first, then Base
- C.Only Derived
- D.Random order
Answer & explanation
Correct answer: Base first, then Derived
The base part must exist before the derived part is built.
Can you get the rest right without peeking?
Take the timed Quiz: Inheritance and Virtual Functions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →