Polymorphism in C++
Polymorphism in simple means having many forms. Its behavior is different in different situations. And this occurs when we have multiple classes that are related to each other by inheritance.
For example, think of a base class called a car that has a method called car brand(). Derived classes of cars could be Mercedes, BMW, Audi - And they also have their own implementation of a cars
The two types of polymorphism in c++ are:
- Compile Time Polymorphism
- Runtime Polymorphism
Comments