+ 8
Polymorphism real world example? and what is runtime in runtime polymorphism?
6 Respostas
+ 4
let take a human can perform dance ,study, walk and all so these are the property of human that can perform these task and depending on situation what is need at that time. this you can relate with real world.
+ 3
for example... lets take a class fruit containing methods to tell color() and shape().... now this class will have many inherited classes such as apple, orange, etc... and each inherited class will have different shape() and color().... so the same methods shape and color are used in different classes in different manner.... that is polymorphism....
+ 3
Polymorphism (Object Oriented) explained better :
1) Father : Son, go and get Red Label.
Son : 750 ml or 1 L ? ..
2) Mother : Son, go and get Red Label.
Son : 500g or 1 kg ? ... 😂
+ 1
I just wrote example. You can check it in my codes. "Java Run-Time and Compile Polymorphism" Hope it will help
+ 1
Hmm I admit at first I did not get the question. You are serching for real life metaphor for it. I think that runtime polimorphism is just any activity, that looks diffrent depends who is performing it. For example if good dancer is dancing the result is ovations and admiration, but if dancer is clumsy it results in laughter. the same action, different result, depands on performer.
- 1
who is the best application in android c++