Question: Q. Explain how to invoke a superclass method from a subclass method for the case in which the subclass method overrides a superclass method and
Q. Explain how to invoke a superclass method from a subclass method for the case in which the subclass method overrides a superclass method and the case in which the subclass method does not override a superclass method. [1 Mark]
this is a correct answer but i want answer it in different way :
-
In the case where the subclass method overrides the superclass method, it is necessary to explicitly use the keyword super, to invoke the method of the superclass as super.methodName().
When the subclass method does not override the superclass method, the superclass method can be invoked simply by using its name and appropriate arguments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
