Multiple choice technology programming languages

Which method calls another constructor from within a constructor within a class?

  1. this()

  2. super()

  3. both

  4. none of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The this() keyword is used to call another constructor from within a constructor in the same class (constructor chaining). It must be the first statement in the constructor body. The super() keyword calls the parent class constructor, not a same-class constructor.