Polymorphism means many forms. It can be used when classes use a hierarchy by using inheritance. It is achieved by using the function overriding and virtual functions. Polymorphism can occur at different times like at run-time and at compile time or can say late binding or early binding.