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

What is the purpose of javac exe?

560


Where are register variables stored?

593


Differentiate between run time error and syntax error.

573


When is the arraystoreexception thrown?

570


What is the significance of java packages?

614






Write a code to create a trigger to call a stored procedure

537


What is return data type?

561


Explain java coding standards for classes or java coding conventions for classes?

617


What is an argument in java?

511


What are java methods?

576


What is the use of volatile in java?

601


What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?

518


What is collections framework?

578


What is finalize()?

608


Is string serializable in java?

545