Real life example of Polymorphism
Another definition of polymorphism;
Polymorphisms is nothing but ability to take more than one forms(One Interface,Multiple Methods or One Name,Many Forms).
Example 1:
A Person who knows more than two languages he can speak in a language which he knows. Here person is Object and speak is polymorphisam.Example 2:
Another Common Example: you don't "need to know the internal working of the mobile phone to operate" with it. You have an interface to use the device behaviour without knowing implementation details.Example-3:
A Teacher behaves to student.A Teacher behaves to his/her seniors.
Here teacher is an object but attitude is different in different situation.
No comments:
Post a Comment