Loading…
Loading…
Ten exam-style questions on class initialization, static and instance initializers, constructor chains, source order, final and static final fields, forward references and overridable calls from constructors, with explanations.
Practice questions for the article Java Initialization Order and final Fields.
Trace each program on paper: statics parent first (once), then the constructor chain, then for each class from the top down its instance initializers followed by its constructor bodies. Aim for at least 8 out of 10.
Quiz path: step 38. Take the quizzes in this order, after reading each article.
Previous quiz: Constructors, this() and super() (OCP 21)
Next quiz: Method Overriding and Hiding (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.