Showing posts with label overloading. Show all posts
Showing posts with label overloading. Show all posts

Wednesday, February 24, 2010

Overloading vs. Overriding

Overloading is when you define two methods with the same name, in the same class, distinguished by their parameters.
-> Overloading is resolved at compile time.

Overriding is when you redefine a method that has already been defined in a parent class (using the exact same parameters).
-> Overriding is resolved at runtime (based on the type of the implicit first parameter).