Meaningless Drivel is fun!*
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
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: 230
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: 19785
    
  20

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: 230
thats ok but in some article i have read about methodOverloading uses compile time polymorphism
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
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: 19785
    
  20

I agree.
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 230
ok Thanks guys
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: significance of MethodOverloading