Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

Practice this question and more.


Are member initializers called before or after the base-class constructor in Java?

  1. Before

  2. After

  3. Simultaneously

  4. Not called

The correct answer is: After

Member initializers in Java are called after the base-class constructor. This is because member initializers are included within the body of the constructor, which means they will only execute after the constructor has been called. Option A and C are incorrect because they suggest that member initializers are called before or simultaneously with the base-class constructor, which is not the case. Option D is also incorrect because member initializers are indeed called in Java, just after the base-class constructor.