LearnFrenzy
Sign in Take a free test

Constructors and the this Keyword · Constructors MCQ · Question 6

Where this(...) must appear Answer, explanation & discussion

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

On Java 21, where must a this(...) call appear?

  • A Anywhere in a method
  • B As the first statement of a constructor Correct
  • C As the last statement of a constructor
  • D Only in static blocks
Correct Answer: Option B

And a constructor cannot contain both this(...) and super(...).

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