• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

overloading

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am preparing for scjp 5. I have read many books(Complete Reference, Khild Mughal, Phillip-Heller, K&B) on java. And now I have a confusion.
In Complete Reference and Khaliad Mughal, Overloading is also Polymorphism, but in "Complete Java 2 Certification- Phillip Heller ", writer write strictly that overloading is not polymorphism. I have read Java Specification. In specification, overriding is polymorphism(that is) but about overloading did not write anything.

Group, Please clear my dought, that "Is overloading polymorphism or NOT"

Thanks in advance.
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Polymorphism is the way of method binding at run time. That applies to overridden methods only. Overloaded methods are selected at the compile type on behalf of argument passed to the method.

No overriding of method, no polymorphism.


I find verbose definition of Polymorphism as :


In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.




In C++, overloading is too called Polymorphism!
One liner definition as I recall "One name multiple form"



Regards,
cmbhatt
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic