Suppose we want to perform addition.
We may need:
- addition of two integers
- addition of three integers
- addition of floating-point numbers
Instead of creating separate function names like:
sumInt()
sumFloat()
sumThree()
we create functions having the same name:
sum(int,int)
sum(int,int,int)
sum(float, float)
This is polymorphism because:
The same function name sum() performs different tasks depending on the arguments.