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 / binod kumar

IF WE HAVE SAME METHOD NAME WITH DIFFERENT TYPES OF PARAMETERS THEN IT IS KNOWN AS METHOD OVERLOADING.
EXAMPLE----------->

class A
{
void sum(int a,int b)

{
int s=a+b;
System.out.println("Sum of a+b is:" +s);

}
void sum(int x,int y,int z)
{
int s2=x+y+z;
System.out.println("Sum of x+y+z is:" +s2);

}
}

class ovrloading
{

public static void main(String str[])

{
A a=new A();
a.sum(10,20);
a.sum(10,20,30);
}
}
IN GIVEN EXAMPLE WE HAVE SUM METHOD WITH DIFF PARAMETERS.
OUTOUT WILL BE------->
Sum of a+b is: 30
Sum of x+y+z is: 60

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to store more than 10 objects in a remote server? Which methodology will follow?

3123


How to sort a collection of custom Objects in Java?

995


What is meant by call by reference?

947


What is method and methodology?

1050


How to print an arraylist in java?

1000


How to obtain a performance profile of java program

952


What is the range of the short type?

949


Can list contain null in java?

1032


Which class represents the socket that both the client and server use to communicate with each other?

973


Is java programming easy?

938


What is singleton math?

1049


Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

2662


What is update method called?

1090


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

952


Is object a data type?

917