File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes polymorphism and overloading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "polymorphism and overloading" Watch "polymorphism and overloading" New topic
Author

polymorphism and overloading

ali farid
Ranch Hand

Joined: Aug 26, 2000
Posts: 60

Is overloading by any means concerned with polymorphism ?
Avijeet Dash
Ranch Hand

Joined: Jan 21, 2001
Posts: 148
Polymorphisim is simply 'same name and many forms'.
static polymorphism:
It can be in the form of operator overloading (c++, or '+' for string concatenation in Java ). It can be function overloading i.e. same function name with different input argumant types in the same class or sub classes.
dynamic polymorphism:
function overriding can be done only in subclasses, which means same function name and input arguments and the implementation is different.
Piotr Aniola
Greenhorn

Joined: Feb 20, 2001
Posts: 3
The generally accepted definition of polymorphism is:
"Ability to hide multiple implementations behind a single interface."
So I agree function overloading is polymorphism. So is operator overloading. Any kind of overloading will be polymorphic because the same interface is used to refer to different behaviours.


Piotr Aniola
Mark Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
Piotr,
Overloaded functions do not represent the same interface, so maybe your definition is refering to "dynamic polymorphism" mention by Avijeet in the previous message.
 
 
subject: polymorphism and overloading
 
Similar Threads
Dan's Mock #4 Q. 25
polymorphism,overloading and overiding seems to be the same thing for me
Overloading is Polymorphism?
Method Overloading and overriding
is overloading example of static or dynamic polymorphism