LearnFrenzy
Sign in Take a free test

Constructors and the this Keyword · Constructors MCQ · Question 11

When an instance initialiser block runs Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

When does an instance initialiser block { … } run?

  • A Once, when the class loads
  • B For every new object, after the superclass constructor and before the rest of this constructor's body Correct
  • C After the constructor finishes
  • D Only when called explicitly
Correct Answer: Option B

It runs together with field initialisers, in source order.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links