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

A class has a field initialiser and an instance block. Which runs first?

A class has a field initialiser and an instance block. Which runs first?

  1. A.Always the field initialiser
  2. B.Always the instance block
  3. C.The constructor body
  4. D.Whichever appears first in the source code
Answer & explanation

Correct answer: Whichever appears first in the source code

Field initialisers and instance blocks run top to bottom, before the constructor body.

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 →