Method overriding in java can be defined as a method in a subclass or child class that is already present in the superclass. That means the method of the subclass is having the same name, same parameter, and the same return type as the method of its superclass. The method of the superclass is known as the overridden method, whereas the subclass method is class as the overriding method. We have already seen the  method overloading in this blog.

Method Overriding in Java

In any object-oriented programming language, Overriding is the feature that allows a subclass or child class to provide a specific implementation of the method that is already provided by one of its super-classes or parent classes.

When a method in the subclass has the same name, same parameters or signature and same return type as the method in its super-class, then a method in the subclass is said to override a method in the super-class.

#java #programming #java method overriding

Method Overriding in Java Example | Java Method Overriding
3.70 GEEK