← 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?
- A.Child's constructor
- B.Parent's constructor
- C.Parent's static block
- 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 →