Polymorphism:
- Poly means many and prism means form so polymorphism means many forms.
- It is used to perform a single action in different ways.
- For example,
- Action is drawn and it performance maybe draw a line or draw a circle.
Types of polymorphism:
1. Runtime polymorphism
2. Compile time polymorphism
Runtime polymorphism:
- The runtime polymorphism is also called dynamic polymorphism.
- It is the best example is method overloading.
Example program:
Compile-time polymorphism:
- The runtime polymorphism is also called static polymorphism.
- It is the best example is method overriding.
Example program:
Note:
- If you need to detail learning of method overloading and method overriding concepts then please click the below link to helpful.
https://www.whereisstuff.com/2021/02/method-overloading-and-overriding-in-c.html





