🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Object Initialization Order: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. When does a class's static block run?
  3. Q3. A class has a field initialiser and an instance block. Which runs first?
  4. Q4. What does this print? (code)
  5. Q5. Parent Person has only the constructor Person(String name). What happens with class Student extends Person { Student() { } }?
  6. Q6. Where must this(...) or super(...) appear inside a constructor?
  7. Q7. What does this print? (code)
  8. Q8. For new Child() where Child extends Parent (both used for the first time), what runs first?
  9. Q9. Why is calling an overridable method from a constructor risky?
  10. Q10. Which kind of method is safe to call from a constructor?