Difference between method Overloading and Overriding in Java.
Method Overloading | Method Overriding |
---|
1) Method overloading increases the readability of the program. | Method overriding provides the specific implementation of the method that is already provided by its superclass. |
2) Method overloading occurs within the class. | Method overriding occurs in two classes that have IS-A relationship between them. |
3) In this case, the parameters must be different. | In this case, the parameters must be the same. |
Recent Posts