3

I saw this in book:

class Student implements Person,Named
{
    public String getName(){return Person.super.getName();}
}

There is a same method in Person and Named called getName().

I have never seen the grammar above before.

I know super.getName() means it called the parent's method, but why must it be called with Person there?

OneCricketeer
  • 151,199
  • 17
  • 111
  • 216
lxacoder
  • 181
  • 1
  • 9

0 Answers0