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
Which class should you use to obtain design information about an object in java programming?
Can anonymous class have constructor?
What does g mean in regex?
What are voids?
What is the difference between break and continue statements?
What is unmodifiable collection in java?
What is the synonym of framework?
please send me hr interview questions in it industry
What are the 2 types of java programs?
What is integer size in java?
Where are the local variables stored?
What purpose do the keywords final, finally, and finalize fulfill?
Is string an object?
What are the restrictions imposed on method overriding?
Is char * a string?