This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes significance of MethodOverloading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "significance of MethodOverloading" Watch "significance of MethodOverloading" New topic
Author

significance of MethodOverloading

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 228
HI

Whats the advantage of overloading methods,

i know its a supports polymorphsm,
is there any other which cause java to use method overloading heavily.
does it saves memory ??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

ravindra patil wrote:i know its a supports polymorphsm,

No it doesn't. That's overriding.

is there any other which cause java to use method overloading heavily.
does it saves memory ??

It does not save memory, nor consume extra memory. There is one very simple reason - you won't need to think of new names for methods that do the same but with a few more or less parameters.

Check out this thread, and my example in it.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 228
thats ok but in some article i have read about methodOverloading uses compile time polymorphism
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37897
    
  22
A lot of people talk about overloading and compile-time polymorphism, but I think that is a bad term.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

I agree.
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 228
ok Thanks guys
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: significance of MethodOverloading
 
Similar Threads
Overriding,Overloading methods
method overriding
overloading
java [question -- overloading]
overlading