🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Inheritance and Polymorphism: all 10 questions

Quiz: Inheritance and Polymorphism · Question 2 of 10

Where must super(...) appear in a constructor?

Where must super(...) appear in a constructor?

  1. A.Anywhere
  2. B.As the first statement
  3. C.As the last statement
  4. D.Only in the parent class
Answer & explanation

Correct answer: As the first statement

A call to super(...) must be the first statement in a constructor.

Can you get the rest right without peeking?

Take the timed Quiz: Inheritance and Polymorphism quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →