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
List some important features of java 10 release?
Does java set allow duplicates?
Explain what access modifiers can be used for variables?
Can we change the scope of the overridden method in the subclass?
Is a boolean 1 bit?
Explain yield() method in thread class ?
Convert Binary tree to linked list.
Why does my function print none?
What methodology can be employed to locate substrings inside a string?
Does java support function overloading, pointers, structures, unions or linked lists?
What are the 4 types of characters?
How does predicate work in java?
Difference between comparator and comparable in java?
What are user defined exceptions?
What is early binding and late binding in java?