Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is overloading in java?

Answer Posted / saurabh

it is a example of overloading:-
class Overload {
void test(int a) {
System.out.println("a: " + a);
}
void test(int a, int b) {
System.out.println("a and b: " + a + "," + b);
}
double test(double a) {
System.out.println("double a: " + a);
return a*a;
}
}
class MethodOverloading {
public static void main(String args[]) {
Overload overload = new Overload();
double result;
overload.test(10);
overload.test(10, 20);
result = overload.test(5.5);
System.out.println("Result : " + result);
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

985


What is the purpose of the system class in java programming?

1007


What is rmi and steps involved in developing an rmi object?

994


What are different type of exceptions in java?

916


What does java ide mean?

1057


What is an example of a constant variable?

1013


Is constructor inherited?

915


In a container there are 5 components. I want to display all the component names, how will you do that?

2139


what is daemon thread and which method is used to create the daemon thread? : Java thread

907


What are the advantages of exception handling?

1012


When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

1002


Is multiple inheritance supported by java?

925


Can a constructor call another constructor?

924


What are the different tags provided in jstl?

915


What is OOP's Terms with explanation?

1125