Anyone explain polymorphism with real time example?
take a simple example of run ..bike used for run , car used for run , bus used for run ...so run method is used by different object with different implementation of run () method .
I think polymorphism is where a certain function or method is used differently in different classes
Polymorphism also refer to facilities that enable the programmers to use value/variable/ subprogram in different ways
Example...like when a bell rings in a school....student respond differently some go to class some go to library nd canteen.....ring is for all but they respond in diff form
Poly means many and morphism means forms.......for 1 input we get different output is called as polymorphism