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

Explain the init method?

737


Does chrome use java?

723


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

1837


Why do we use threads in java?

810


Can memory leak in java?

797


Explain java code for recursive solution's base case?

784


What are different types of expressions?

753


Can you sort a string in java?

689


Explain the reason behind ending a program with a system.exit(0)?

814


What is codebase?

764


What is difference between array and arraylist in java?

704


What is static variable with example?

770


What is meant by object?

790


What is factor r?

733


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

942