Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

real time and compile time polymorphism example conflict

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My friend said the only example for real time polymorphism is over riding and for compile time its over loading.. is it true that no other example exists except for these?

Thanks,
Satya.
 
Saloon Keeper
Posts: 15705
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Polymorphism is a word used for various things. I think "compile time polymorphism" and "runtime polymorphism" are especially poor phrases, and make it appear that the two concepts are related. They are not.

You should just use the words "overriding" and "overloading".
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

satya dasika wrote:My friend said the only example for real time polymorphism is over riding and for compile time its over loading...


I'm totally with Stephan on this one; the term "compile-time polymorphism" is an oxymoron to me, and also doesn't describe method overloading precisely (although I am aware that the term is used that way).

Polymorphism (overriding) is about providing different behaviour; method overloading is usually about providing variants of the same behaviour, and is therefore a form of specialization. Overloaded methods will also typically share a lot of code; indeed they may well be the same code, just called with different defaults or with different primitive arguments.

satya dasika wrote:is it true that no other example exists except for these?


It depends what you mean by "example". In the general terms you describe, I would say that there's only one form of polymorphism, but I am admittedly old-school.

Winston
 
reply
    Bookmark Topic Watch Topic
  • New Topic