Home » java » Java Method Overriding

Java Method Overriding

In java programming, when a super class and sub class both has a method that has the same name and type signature than sub class method overrides its superclass method.

Such methods are called the overridden method and this process is said to be method overriding.

Result

Note: If we want to access the super class overridden method, we can do so by using super keyword.

Note: Overriding occurs only when the method name and parameter list of the method are identical.  

Method with same name and different parameter list are simply overloaded not overridden.

Result

Please follow and like us:
error