Java OCA OCP Practice Question 1188

Question

Fill in the blanks:

___ is used to call a constructor in the parent class,

while ___ is used to reference a member of the parent class.

  • A. super and this()
  • B. super and super()
  • C. super() and this
  • D. super() and super


D.

Note

The super() statement is used to call a constructor in the parent class, while super is used to reference a member of the parent class.

The this() statement is used to call a constructor in the current class, while this is used to reference a member of the current class.

Option D is the correct answer.




PreviousNext

Related