• 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
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Do method overloading is a type of polymorphism?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Vineet Tyagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some one please help me to remove my confusion
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vineet Tyagi wrote:Some one please help me to remove my confusion


Well it would help if you actually posted a specific question. If your subject line was supposed to be self-explanatory: it isn't.

Exactly what are you confused about? About all I can tell you right now is that method overloading is the mechanism by which polymorphism is achieved; but I doubt whether that helps much.

Winston
 
Vineet Tyagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all thanks and yes its helpful a litle bit...im confused because i have a belief that compile time polymorphism is achieved by method overloading.
But Head First Java says that overloading methods has nothing to do with polymorphism!!!
I think now i am more claer about my confusion...
 
Marshal
Posts: 73284
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I knwo there are people who disagree, but I think Head First is correct to say polymorphism requires overriding. That also means that the only thing which can be polymorhpic is the only thing which can be overridden, which is a non‑private non‑final instance method.
 
Vineet Tyagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answer. I have read in many books that overloading is a type of polymorphism. I do agree that overriding must be there for polymorphism.
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vineet Tyagi wrote:I have read in many books that overloading is a type of polymorphism.


Ooops. Mis-read the question. I was talking about method overriding.

In my view: No. Method overloading is NOT a form of polymorphism. You'll sometimes see it referred to as 'static polymorphism', which makes absolutely no sense to me at all, since the term is an oxymoron.

Winston
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, Method overloading is a type of polymorphism
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

BalaMurali dhar wrote:yes, Method overloading is a type of polymorphism


So, two disagreeing viewpoints: Would you care to explain why you think overloading is polymorphism?

Winston
 
Vineet Tyagi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

BalaMurali dhar wrote:yes, Method overloading is a type of polymorphism



yes please explain your view..
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also think that overloading method is not a type of polymorphism. A polymorphism is an ability of an object to take many forms and as I remember in headfirst, objects are blueprint of a class and object must have state and behavior but overloading methods are only behavior.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic