what is overloading in java?
Answer Posted / irshad ahmad
Method overloading in java:
create more than one methods that have same name, but
different parameter lists and different definitions, within
a class.
It is used when objects are required to performed similar
tasks but with using different input parameter list.
class ABC
{
int x,y,z;
void star(int a,int b,int c)
{
x=a; y=b;z=c;
}
void star(int a,int b)
{
x=a; y= z=b;
}
void star(int a)
{
x= y= z= a;
}
int result()
{
return(x*y*z);
}
}
| Is This Answer Correct ? | 43 Yes | 18 No |
Post New Answer View All Answers
What is a list in java?
What is data object example?
what are Hostile Applets?
What is Recursion Function?
What is a lock or purpose of locks in java?
In java, how we can disallow serialization of variables?
Why is stringbuffer faster than string?
Is a char always 1 byte?
Why do we need singleton?
What is an 8 bit word?
What is lambda in java?
What does int argc char * argv [] mean?
What are the object and class classes used for?
How do you escape json?
What is static method with example?