Basic Concepts of OOP: Polymorphism

In this tutorial, I will explain the basic concepts of polymorphism of OOP (Object Oriented Programming). I will make this tutorial as easy as possible so that it would be easy to understand to everyone.

What is Polymorphism?

The word Polymorphism is a Greek word from polys means “many, much” and morphē means of many forms. Polymorphism is the 3rd pillar of OOP (Object Oriented Programming). Object oriented programming is incomplete without having the polymorphism. In the other words, “many forms of a single object is called Polymorphism”.

There are two types of polymorphism:

  1. Compile time polymorphism
  2. Runtime polymorphism

Compile time polymorphism

In C++ programming language, you can write the c++ programs by compile time polymorphism in two way which is described below in details.

  1. Function overloading
  2. Function overriding

Runtime polymorphism

In C++ programming language, you can achieve the Runtime polymorphism with the help of virtual function.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , , , , ,