1. A feature of inheritance that allows a subclass object to be treated as if it were one of its superclasses. Where the subclass and the superclass have different implementations of a method, that of the subclass is used. Polymorphism is a major contributor to the power of object-orientated languages.
2. A feature of several modern high-level programming languages that allows arguments to procedures and functions to vary systematically over a whole class of data types, rather than being restricted to a single type. A simple example would be a function to find the length of a list. The code for such a function should be the same for lists of integers, lists of Booleans, or lists of anything. In a language like Algol, however, the argument to such a function must have a single type; hence to handle both lists of integers and lists of Booleans, two functions would have to be defined. This can be avoided in languages that support polymorphic types like ‘list of alpha’, where alpha is a type variable standing for an arbitrary type. A polymorphic function is one that takes one or more arguments of polymorphic types.
Polymorphism was first used in the ML language. Its implementations in modern languages are usually called generics (Ada, Java, C#, VB.NET) or templates (C++).