Friday, May 29, 2009

Differences between method overriding and method overloading

Method OverridingMethod Overloading
Arguments of overloaded methods cannot be changed.Arguments of overloaded methods can be changed.
Method return types cannot be changed except covariant return types. Return types can be changed.
Exceptions must not throw new or broader checked exceptions.Exceptions can be changed.
It happens at runtime.It happens at compile-time.
An object type determines which method is selected.A reference type determines which method is selected.

No comments:

Post a Comment