What is polymorphism in C++?

Polymorphism

Poly means more than one and morphism means forms.

So, polymorphism means having more than 1 forms.

 

Polymorphism can be classified as-:

1)Compile time polymorphism

2)Run-time polymorphism

 

Compile time polymorphism is implemented through function overloading and operator overloading.[ Compile time polymorphism is also called static polymorphism or early binding because a compiler links the appropriate function definition for a particular function call before the program is running].

Run time polymorphism is achieved through virtual functions.

[Run time polymorphism is also called late binding or dynamic binding because appropriate function definition for a particular function is known by the compiler only when the program is running].

Leave a Comment

Your email address will not be published. Required fields are marked *

Do NOT follow this link or you will be banned from the site! Scroll to Top