← 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?
- A.Anywhere
- B.As the first statement
- C.As the last statement
- 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 →