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 difference between word and integer?

599


What is class forname used for?

542


What is return type in java?

640


Explain java coding standards for interfaces?

636


How will you invoke any external process in java?

606






Can you explain the meaning of aggregation and composition

574


How many decimal digits is 64 bit?

536


Why is singleton class used?

529


What is core java called?

526


How do you compare characters in java?

525


What is a null point?

559


What is a dynamic array java?

523


How to stop a thread in java? Explain about sleep () method in a thread?

590


Is null a string in java?

558


What is a arraylist in java?

562