1.

What do you understand about Polymorphism in Object Oriented Programming?

Answer»

Polymorphism in Object-Oriented Programming is defined as the presence of several forms. It is made up of two words: "POLY" which means many and "morph" which means FORM. Its behaviour varies depending on the situation. When we have numerous CLASSES that are related to each other by inheritance, this happens. Consider a base class named car, which has a method called carBrand(). VOLKSWAGEN, Ferrari, BMW and Audi are examples of derived automobile classes, and each has its own implementation of a car. In C++, there are two types of polymorphism:

  • Compile TIME Polymorphism or Static Polymorphism.
  • Runtime Polymorphism or Dynamic Polymorphism.


Discussion

No Comment Found