Difference between Overloading and Overriding

Overloading v\s Overriding

1.In overloading method signature can be changed but in overriding method signature cannot be changed.
2.Static methods are overloaded by static as well as non static methods but in overriding static methods can be overridden by only other static method.
3.Overloading concept is applicable in obscene of inheritance but in overriding method is applicable only when inheritance occurs.
4.Overloading can be done in both parent class as well as child class but in overriding can be only in child class
5.Overloading is compile time activity where overloading is runtime activity.
6.Overloading method can be have different return type but in overriding method return type must be same as super class .
7.Constructor can be Overloaded but cannot be overridden.
8.Final method can be overloaded but cannot be overridden

Comments