Real time example of polymorphism
Example
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dinesh SanthalingamPosted Mar 10, 2017, 1:48 AM
Gnanavel SekarPosted Mar 10, 2017, 12:52 AM
Brajesh KumarPosted Mar 10, 2017, 12:46 AM
In OOP this is expressed through interfaces.
So, it would be modelled something like this:
Now you can use those behaviours and the fact that he is a human in different cases.
Like:
So, polymorphism is about
ONE object that behaves different in different cases... and inheritance.Rafnas T PPosted Mar 9, 2017, 11:51 PM