Java - Inheritance
In Java, how do you correctly invoke another constructor of the same class from within a constructor?
this() and it must be the first statement in the constructor.this() as the first statement inside the constructor correctly states the use of this() as the first statement. By calling the constructor name directly inside the constructor body is invalid syntax. By using super() inside the constructor calls the superclass constructor, not the same class constructor. By creating a new object of the class inside the constructor creates a new object, not chaining constructors.this() as the first statement inside the constructor -> Option Bthis() first [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions