• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

significance of MethodOverloading

 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats ok but in some article i have read about methodOverloading uses compile time polymorphism
 
Campbell Ritchie
Sheriff
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot of people talk about overloading and compile-time polymorphism, but I think that is a bad term.
 
Rob Spoor
Sheriff
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok Thanks guys
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic