Polymorphism is made of two Greek words Poly which means many and morphos which means many forms. So, Polymorphism means many forms. It is a technique in which an object, operator, function or variable is used for performing multiple operations. So, when an object, operator, function or variable is used in many forms it is known as Polymorphism. Polymorphism is implemented by Function overloading and Operator overloading in C++ as in the case of function overloading a single function name is used for calling different functions and in case of operator overloading, an operator is used for performing multiple related operations.
Types of Polymorphism:
- Compile time polymorphism
- Run time polymorphism