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 difference between synchronize and concurrent collection in java?
Why do we need wrapper classes?
What is the use of predicate in java 8?
Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain
What are internal variables?
Is sizeof a keyword in java programming?
What is difference between call by value and call by reference?
How do weakhashmap works?
What are the library functions in java?
What is empty string literal in java?
Can we clone singleton object in java?
Is it possible to instantiate the abstract class?
What is local variable and instance variable?
Can you pass by reference in java?
Detail discussions on JVM, memory management and garbage collector.