Polymorphism in java
Polymorphism:
If an object exists in more than one form, it is called polymorphism.
This is a Greek word poly means many and morphism means structure or form.
There are two types of Polymorphism:-
- Static Polymorphism
- Dynamic Polymorphism
Static Polymorphism:
If polymorphism is present at compile time then it is called static polymorphism
EX: Overloading.
Dynamic Polymorphism:
If polymorphism exists on the inference then that polymorphism is called motion polymorphism.
EX: Overriding