Calling base class overridden function from base class method

Unfortunately, no

As i’m sure you’re aware, but I’ll state explicitly for completeness – there are only the 2 keywords to control the method invocation:

  • thisthis.method() – looks for method starting from the invoking instance’s class (the instance’s “top” virtual table – implied default)
  • supersuper.method() – looks for method starting from the parent class of the class in which the invoking method is defined (the invoking class’ parent’s virtual table – not strictly true, but simpler to think of this way – thanks @maaartinus)

I can imagine another keyword (e.g. current?) do what you describe:

  • currentcurrent.method() – looks for method starting from the class in which the invoking method is defined

but Java doesn’t have such a keyword (yet?).

Leave a Comment