Results 21 to 23 of 23
Thread: Method Overloading Verification
- 11-27-2010, 08:12 AM #21
Member
- Join Date
- May 2010
- Posts
- 90
- Rep Power
- 0
return type is not used for method overloading.
for method overloading two methods should have some change in parameter list.
consider this
class x
{
void getdata()
{
int x =1;
}
int getdata() //-------------- line number 7
{
int x =1;
return x;
}
}
when compile we get an error like this
x.java:7: getdata() is already defined in x
int getdata()
^
compiler consider both methods as same
- 11-27-2010, 04:11 PM #22
Member
- Join Date
- Oct 2010
- Posts
- 80
- Rep Power
- 0
Method Overloading Verification
Thank you jomypgeorge, & everyone who helped me to understand the Overload method concept.
As always I am deeply appreciative.
lala
- 11-30-2010, 05:32 AM #23
Member
- Join Date
- May 2010
- Posts
- 90
- Rep Power
- 0
Similar Threads
-
Overloading qn
By diskhub in forum New To JavaReplies: 18Last Post: 06-07-2010, 05:19 PM -
method overloading and arrays.
By glopez09 in forum New To JavaReplies: 5Last Post: 12-08-2009, 03:02 PM -
Demonstration of both constructor and ordinary method overloading
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:43 PM -
Overloading?
By padutch2 in forum New To JavaReplies: 2Last Post: 12-31-2007, 03:26 AM -
Method/Operator Overloading
By Java Tip in forum Java TipReplies: 0Last Post: 12-01-2007, 08:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks