Polymorphisim is simply 'same name and many forms'. static polymorphism: It can be in the form of operator overloading (c++, or '+' for string concatenation in Java ). It can be function overloading i.e. same function name with different input argumant types in the same class or sub classes. dynamic polymorphism: function overriding can be done only in subclasses, which means same function name and input arguments and the implementation is different.
Joined: Feb 20, 2001
The generally accepted definition of polymorphism is: "Ability to hide multiple implementations behind a single interface." So I agree function overloading is polymorphism. So is operator overloading. Any kind of overloading will be polymorphic because the same interface is used to refer to different behaviours.
Joined: Feb 08, 2001
Piotr, Overloaded functions do not represent the same interface, so maybe your definition is refering to "dynamic polymorphism" mention by Avijeet in the previous message.