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 singleton class? Give a practical example of its usage.
Is sizeof a preprocessor?
What are the differences between forwarding () method and sendredirect() methods?
What function extracts specified characters from a string?
What is the method overriding?
What is use of valueof () in java?
What is java util concurrentmodificationexception?
How many types of design patterns are there?
Variable of the boolean type is automatically initialized as?
Are maps ordered java?
Explain the importance of import keyword in java?
What is a pointer and does java support pointers?
What are the three parts of a lambda expression?
What is backdrop?
What are triggers in DB? Explain their types. How do they work?