Java OCA OCP Practice Question 1303

Question

What is the command to call one constructor from another constructor in the same class?

  • A. super()
  • B. this()
  • C. that()
  • D. construct()


B.

Note

The super() statement is used to call a constructor in a parent class.

The this() statement is used to call a constructor in the same class.

Option B is correct and Option A is incorrect.

Options C and D are incorrect because they are not constructors.




PreviousNext

Related