• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Polymorphism applies to overriding, not to overloading??

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
K&B chapter 5(two minute drill) says.."Polymorphism applies to overriding, not to overloading".
I don't agree with this. It applies to both overloading and overriding. I consider overloading as compile time polymorphism and overriding as run time polymorphism . Any thoughts on this..?
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can not polimorphically call overloaded method .
I would not consider overloaded method having any kind of polymoprhic
behavior, maybe only when if you do Reflective programming and you invoke all methods with same name but different parameters ... hmmm. even them ...
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prashanth Kayampady:
...I consider overloading as compile time polymorphism...


Because methods are identified by their fully qualified class name, method name, and ordered argument types, overloading is really just a variation in naming. From the compiler's perspective, overloaded methods are unrelated and are not a form of polymorphism.
 
reply
    Bookmark Topic Watch Topic
  • New Topic