• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

real time example for polymarphism  RSS feed

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi one and all,

For inheritence there is an real time example like.... Family tree

but i want to know for polymorphism.

please fwd to me anyone.
thanks,
Vijay
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing you meant "real life" instead of "real time". It's tough to apply some OO concepts to things outside software. But since you mentioned a family tree, suppose I have a father and son. I ask the father to put on some music and he plays a 1940's big band CD. I ask the son to put on some music and he plays Green Day. I send them both the same message, they both understand the message, but they do different things in response.

If I ask the dog to put on some music he just tilts his head and looks at me funny. He doesn't understand the message, no polymorphism at work.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!