Real time example of polymorphism
Example
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Brajesh KumarRank #678 · 3.5K reputationPosted Mar 9, 2017, 7:46 PM EST
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.Dinesh SanthalingamRank #2,085 · 690 reputationPosted Mar 9, 2017, 8:48 PM EST
Gnanavel SekarRank #333 · 7.5K reputationPosted Mar 9, 2017, 7:52 PM EST
Rafnas T PRank #280 · 8.8K reputationPosted Mar 9, 2017, 6:51 PM EST