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

State the difference between creating string as new () and literal.

1183


What is ‘is-a ‘ relationship in java?

1113


What is the primitive type byte?

1043


how to deploy apache tomcat server to weblogic server in java

2152


What is the purpose of garbage collection in java, and when is it used?

1091


What are the object and class classes used for?

1090


Differences between C and Java?

1286


When throws keyword is used?

1044


What is the use of join method?

1086


What is map and hashmap in java?

1118


Explain the difference between string, stringbuffer and stringbuilder in java?

1055


How can you share data between two thread in Java?

983


Can we nested try statements in java?

1147


What is an interoperable application in java ?

1059


Explain the importance of join() method in thread class?

1136