Java: How to invoke a superclass version of an Overridden method?

inicial › Forums › Java › Java: How to invoke a superclass version of an Overridden method?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2292628
    matheusdba
    Keymaster

    How to invoke a superclass version of an Overridden method?

    #2292629
    matheusdba
    Keymaster

    To invoke a superclass method that has been overridden in a subclass, you must either call the method directly through a superclass instance or use the super prefix in the subclass itself. From the point of view of the subclass, the super prefix provides an explicit reference to the superclass’ implementation of the method.

    // From subclass
    super.overriddenMethod();
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.