← Quiz: Multiple Inheritance and the Diamond Problem: all 10 questions
Quiz: Multiple Inheritance and the Diamond Problem · Question 6 of 10
With virtual inheritance, which class constructs the shared virtual base?
With virtual inheritance, which class constructs the shared virtual base?
- A.The first middle class listed
- B.Each middle class, once per path
- C.The most-derived class, the class of the object actually being created
- D.Nobody; virtual bases have no constructor
Answer & explanation
Correct answer: The most-derived class, the class of the object actually being created
Arguments that the middle classes pass to the virtual base are ignored when they are not the most-derived class.
Can you get the rest right without peeking?
Take the timed Quiz: Multiple Inheritance and the Diamond Problem quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →