What is polymorphism concept?

What is polymorphism concept?

In simple words, polymorphism means that some code or operations or objects behave differently in different contexts. It is also called overloading.

As a real-life example, a woman takes multiple roles like - mother, homemaker, office-worker, etc. So, women assume different roles in a different scenario and exhibit different behaviour.

As an example, you can assume we have two functions with same name but different number of arguments. So, based on how many and what parameters we pass during function call determines which function is to be called, this is why it is considered as an example of polymorphism because in different conditions the output will be different.