Java OCA OCP Practice Question 640

Question

You want to invoke the overridden method from the overriding method named m().

Which of the following constructs which will let you do that?

Select 1 option

  • A. super.m ();
  • B. super.this ();
  • C. base.m ();
  • D. parent.m ();
  • E. super ();


Correct Option is  : A

Note

Calling super(); means you are trying to call the super class's constructor.

But you can't call the super class's constructor or its own constructor from a method, therefore calling super() from a method is not valid.

super () can only be the first statement of a constructor.




PreviousNext

Related