Polymorphism is the ability of an object or its methods to take on many forms depending on its type and the parameters of this or that method.
The mechanism of defining several methods with the same name but with different parameters is known as overloading.
The technique to redefine methods of the parent class in its subclasses is called overriding.
We can use polymorphism to define how we want our objects to behave depending on their type or the parameters of their methods. We can:
- overload methods with different parameters;
- override methods in subclasses;
- use duck typing.
Not all of these techniques are possible to use in your programming language, so you should check the information about it in other topics or refer to the documentation.