Consider an operation of addition . For two numbers, the operation will generate a sum. If the operands are strings, and the same operation would produce a third string by concatenation. This feature is called -
For two numbers, the operation will generate a sum. If the operands are strings, and the same operation would produce a third string by concatenation. This feature is called polymorphism.
Polymorphism means the ability to take more than one form. It allows different objects to respond to the same message in different ways. It is the ability for a message or data to be processed in more than one form. The same operation is performed differently depending upon the data type it is working upon.
Method overloading is an example of static polymorphism, while method overriding is an example of dynamic polymorphism.