• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

real time example for polymarphism

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic