In Object Oriented Programming, polymorphism (properly: parametric polymorphism) enables us to process objects differently based on their type. It is usually accomplished by allowing derived classes to redefine methods of a base class in order to replace or extend the behaviour of those methods.

The classic example is a base class called Shape and a set of derived classes such as Circle and Triangle. The base class implements an abstract draw method, and the derived objects override it with their own drawing code. Except for the object type, the method signatures are the same.