next up previous contents
Next: Overloading of Operators Up: Polymorphism Previous: Polymorphism   Contents

Overloading Methods as a Form of Polymorphism

The best-known example of polymorphism is the ability to replace the three C functions,

by a single JAVA function called ABS().

C requires three different functions which depends on the data types. In JAVA only one name of the function is needed for any data types, int, long, float. It is said in this situation that function or method is overloaded. This situation is recognised by a compiler, and polymorphism of this kind is called compile-time polymorphism. Some authors say also about early binding or static binding in this case. They usually do not consider function overloading to be a ``true'' polymorphism.



Olexiy Ye. Tykhomyrov 2001-12-16