Hi

I think it gives you advantage of providing same name to the methods having similar functinalities e.g.
int calculateInterest()
int calculateInterest(float interest)

Compiler simply allow the mutiple methods with same name but diffrent signature and gives you the above advantage.

regards
Swapan Kumar Nandi




----- Original Message ----- From: "java programming with" <maksum...@gmail.com> To: "Java EE (J2EE) Programming with Passion!" <java-ee-j2ee-programming-with-passion@googlegroups.com>
Sent: Wednesday, March 02, 2011 3:52 PM
Subject: [java ee programming] Method overloading


Hi guys,

I was wondering about method overloading. What all are it's
advangages? Does it save memory? if it is then how? or it's just abt
reducing complexity & better readability?

e.g.  Is there any advantage of using class A over class B. ( See
below)
class A{

void method(){
// do something
}

void method(int a){
// do something
}
}

&

class B{

void methodNoArg(){

// do something
}

void methodInt(int a){
// do something
}
}


Thanks

--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en


--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to