🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.The first middle class listed
  2. B.Each middle class, once per path
  3. C.The most-derived class, the class of the object actually being created
  4. 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 →