0

I have two classes, Person and Student, where Student extends Person and both classes have the get method.

I made an object from Student and I want to call both get with this object. how can I super the method of the superclass? Or is there any other way for doing that?

SilverNak
  • 3,283
  • 4
  • 28
  • 44
Mostafa
  • 45
  • 10

1 Answers1

0

super codeword in java serves as a reference to the super class.
So, for example we have a get() method in Person class and another in Student class which extends Person .
To call get() method of Person inside Student we can just use super.get().

Mk Km
  • 94
  • 6