METHOD OVERLOADING VS OVERRIDING

Method Overloading v/s Overriding

Overloading

Overriding

1. Happens within the same class.

1. Happens between superclass and subclass.

2. Method signature should not be same.

2. Method signature should be same.

3. It happen at time of compliance or we   can say overloading is the early binding or   static binding.

3. It happen on time of run time or we can say   overriding is dynamic binding or let binding.

4. Method can have any return type.

4. Method have the same return type as the super class.

5. Method can have any access level.

5. Method must have same or wide access level   than super class method access level.