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 best practices should you follow while writing multithreaded code in java?
What are three ways in which a thread can enter the waiting state in java programming?
How many types of interfaces are there?
What is map and hashmap in java?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
Explain method local inner classes ?
Does constructor be static?
Is arraylist a class in java?
What is a null class?
What is a nested structure?
What is meant by method overriding?
What is a newline character in java?
What are white spaces in java?
Define array. Tell me about 2-D array.
What is Java Shutdown Hook?