what is overloading in java?

Answer Posted / vijayakumar chinnasamy

Method overloading:
More than one method have same name but different type
of argument or differnt no. of arguments available in same
class or it subclass is called overloading.

Return type of method and access specifier of method is
not a problem in method overloading.

class A{
void diaplay(int a,int b){ }
void display(float a,float b){ }
void display(float a, int b){ }
void display(int a,int b){
void display(){ }

}

Is This Answer Correct ?    46 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between method overloading and method overriding in java ?

582


How we can run a jar file through command prompt in java?

529


What is main in java?

517


How to make a non daemon thread as daemon?

561


What is the purpose of using the java bean?

578






Why for each loop is used?

508


Explain about data types?

586


What is void keyword?

684


Why there is no call by reference in java?

505


What is class forname used for?

551


Is vector thread safe in java?

567


Explain the init method?

548


Can a class be final?

504


What is difference between array and vector?

545


What are the drawbacks for singleton class?

526