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 does compareto () do in java?
What is java full form?
Does java map allow duplicates?
How will you initialize an Applet?
What is string substring?
Is string serializable in java?
What is java string pool?
Can we assign integer value to char in java?
What if static is removed from main method?
What is a instance variable in java?
How to sort numbers in java without array?
what are the disadvantages of indexes in oracle?
What are static blocks in java ?
What is the difference between a constructor and a method?
What is the difference between class forname and new?