Bird
0
0

Which of the following is the correct way to use this to call another constructor in the same class?

easy📝 Syntax Q12 of 15
Java - Constructors
Which of the following is the correct way to use this to call another constructor in the same class?
Acall(this);
Bsuper();
Cthis.call();
Dthis();
Step-by-Step Solution
Solution:
  1. Step 1: Identify constructor call syntax

    In Java, calling another constructor in the same class uses this(); as the first statement.
  2. Step 2: Eliminate incorrect options

    super(); calls superclass constructor, this.call(); is invalid syntax, and call(this); is not a constructor call.
  3. Final Answer:

    this(); -> Option D
  4. Quick Check:

    Constructor chaining uses this(); [OK]
Quick Trick: Use this(); to call another constructor [OK]
Common Mistakes:
  • Using super(); instead of this();
  • Trying to call constructor like a method
  • Placing this(); not as first statement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes