LearnFrenzy
Sign in Take a free test

Constructors and the this Keyword · Constructors MCQ · Question 4

What the default constructor does Answer, explanation & discussion

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

What does the compiler-generated default constructor do?

  • A Sets all fields to null
  • B Calls the superclass no-arg constructor (super()); fields keep their initial values Correct
  • C Nothing – it is empty with no super call
  • D Prints the class name
Correct Answer: Option B

Field initialisers still run as usual.

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