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.”
[2]The concept is borrowed from a principle in biology where an organism or species can have many different forms or stages.
Subtype polymorphism
Parametric polymorphism (Overloading)
Ad hoc polymorphism (Compile-time)
Coercion polymorphism (Casting)
1subtype polymorphism
In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which a subtype is a datatype that is related to another datatype (the supertype) by some notion of substitutability, meaning that program elements, typically subroutines or functions.
2.parametric polymorphism
programming languages and type theory, parametric polymorphism is a way to make a language more expressive, while still maintaining full static type-safety. 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.
Ad hoc polymorphism
In programming languages, ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorphic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument to which it is applied
Coercion polymorphism
The Coercion polymorphism is called as casting. This type of polymorphism occurs when an object or the primitive is cast into some other type. There are two type of casting. The implicit casting is done using compiler itself, and explicit cast is done using const_cast, dynamic_cast etc.