In programming languages and type theory, polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types.
Most common way of achieving polymorphism is through inheritence/Subtyping. Besides for this there are other ways to achieve polymorphism. The most commonly recognized of which is parametric polymorphism.
Using parametric polymorphism, a function or a data type can be written generically so that it can handle values identically without depending on their type. Such functions and data types are called generic functions and generic datatypes respectively and form the basis of generic programming.
For example, in java, this feature is supported by the name of 'generics'. It is used in the standard Java library collections.
For example, Collections.sort is declared as: