cpp-polymorphism

A C++ code that illustrates the polymorphism(Object Oriented Property) aspect.

Polymorphism

  • This is an aspect exihibited by the OOP languages where a given class exhibit many forms or exist in more than one form.
  • Normally occurs when there is a hierarchy of classes and they are related by inheritance.
  • In the above code, it means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function.
  • Remember, the above code shows both inheritance and polymorphism.

GitHub

View Github