Method overloading v/s method overriding in Java
- Method overloading is a type of compile-time polymorphism whereas method overriding is a type of runtime polymorphism.
- Method overloading increases code readability whereas method overriding provides a specific implementation of the method in a subclass to supersede the one present in the superclass.
- Method overloading is within a class where method overriding is in a subclass.
- In method overloading, the parameter(s) must be different whereas, in method overriding, the parameter(s) should be same.
Published on 02-Feb-2018 15:13:33