posted 19 years ago
Message overloading is having the same method name with different parameters:
method overriding happens when a subclass changes the behaviour of one of its superclasses by implementing the same method in a different way. For example:
This example shows that objects that are Mammals give birth to live young. However, Monotremata (which includes the platypus and the echidna), while they are mammals, lay eggs instead of giving birth to live young. Also, marsupials (kangaroos, opossums, koalas, etc.) give birth to live young but then put the young in a pouch.
An important difference to note is that overloaded methods are bound at compile-time, while overridden methods are determined at run-time.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.