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

For new Child() where Child extends Parent (both used for the first time), what runs first?

For new Child() where Child extends Parent (both used for the first time), what runs first?

  1. A.Child's constructor
  2. B.Parent's constructor
  3. C.Parent's static block
  4. D.Child's instance block
Answer & explanation

Correct answer: Parent's static block

Static initialisation of the parent comes before anything else.

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 →