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 merge-sort principle and its time complexity.

979


What is the most important feature of java? What is an interface?

1015


What is a two-pass assembler?

1053


What is == and === in javascript?

1057


What is lazy initialization in java?

1013


how can i use a nonsynchronized hashtable?

2571


What does pointer mean?

1064


Which class should you use to obtain design information about an object in java programming?

1079


Similarity and difference between static block and static method ?

919


How do you override a variable in java?

1150


What is the difference between the final method and abstract method?

1054


Is java platform independent?

979


What are the rules for variable declaration?

969


List the features of java programming language.

1053


What is the gregoriancalendar class in java programming?

1044