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


Please Help Members By Posting Answers For Below Questions

What is java in detail?

838


What is the program development process?

760


How can you read content from file in java?

811


What is immutable data?

831


What is finally block?

767


Can a serialized object be transferred via network?

718


Can you call a method in a method?

778


What are the wrapped, classes?

809


How can we create objects if we make the constructor private ?

763


From the two, which would be easier to write: synchronization code for ten threads or two threads?

834


Explain reverse a linked list iterative solution in java?

718


What invokes a thread's run() method in java programming?

829


Explain the difference between map and flatmap stream operation?

1045


What are the 6 mandatory procedures for iso 9001?

744


Explain the pointers in Java?

824