When a class has two or more methods with the same name but different
parameters, the call to the appropriate method is made based on the
parameters passed (or respective method body will be bonded with the calling
line dynamically). Method overloading is the term for this mechanism.
In method overriding, methods with the same name and parameters are present
in both the superclass and the subclass. Based on the object used to call
the method, JVM invokes the appropriate procedure. The return types for
overriding should also be the same.
-
Definition,
-
Comparison Chart
-
Key Differences
Post your comment