jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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: 19656
    
  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: 38087
    
  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: 19656
    
  18

I agree.
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 228
ok Thanks guys
 
 
subject: significance of MethodOverloading
 
Similar Threads
overlading
Overriding,Overloading methods
method overriding
overloading
java [question -- overloading]