🎙 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 1 of 10

In class Copier : public Printer, public Scanner, which constructor runs first when a Copier is created?

In class Copier : public Printer, public Scanner, which constructor runs first when a Copier is created?

  1. A.Copier
  2. B.Scanner
  3. C.Printer
  4. D.It depends on the initialiser list order
Answer & explanation

Correct answer: Printer

Base classes are constructed in the order they appear in the class header, then the derived class body runs.

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 →