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

Quiz: Object Initialization Order · Question 9 of 10

Why is calling an overridable method from a constructor risky?

Why is calling an overridable method from a constructor risky?

  1. A.It causes a compile error
  2. B.The subclass version may run before the subclass's fields are initialised
  3. C.Overridden methods cannot be called from constructors
  4. D.It makes the object immutable
Answer & explanation

Correct answer: The subclass version may run before the subclass's fields are initialised

The child's field initialisers run only after the parent constructor finishes.

Can you get the rest right without peeking?

Take the timed Quiz: Object Initialization Order quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →