PDA

View Full Version : What are the differences between Method Overloading and Method Overriding?


rajesh
30-12-2009, 09:21 PM
Method overloading: When 2 or more methods in a class have the same method names with different arguments, it is said to be method overloading. Overloaded methods must have different method signatures

Method overriding : When a method in a class has the same method name with same arguments as that of the superclass,
it is said to be method overriding. Overridden methods must have same signature.

Actually overloading and overriding are different aspects of polymorphism.

static/early binding polymorphism: overloading
dynamic/late binding polymorphism: overriding