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
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Objects or references which of them gets garbage collected?
What is the access scope of protected access specifier?
Explain the difference between the public, private, final, protected, and default modifiers?
What is Classloader in Java?
why java uses class level type casting ?
What is the use of math abs in java?
Where is const variable stored?
Difference between start() and run() method of thread class?
What loop means?
What is public/private protected in java?
What is multiple inheritance? Is it supported by java?
Can we have two main methods in a java class?
5 Coding best practices you learned in java?
what is the difference between thread and runnable types? : Java thread