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...

How can you overload a method?

Answer Posted / rakesh

A class contains more than one function with the same name
but different method signature ie different access
type,return type,parameters.

public void int sum(int i,int j)
{
int tot=i+j;
Console.WriteLine(tot);
}

public void double sum(double p,double q)
{
double tot=p+q;
Console.WriteLine(tot);
}

if we are passing integer values means the first function
will invoke,and if we are passing double values means the
second will work.This is method overloading.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boolean method?

901


Is linkedhashset synchronized?

1056


What is the difference between structure and class in c#?

894


Can I use parseint?

836


Is vs as c#?

854


What is fcl in c#?

826


What is the difference between Singleton design pattern and Factory design pattern?

900


Why are mutable structs evil?

903


Explain the difference between // comments, /* */ comments and /// comments?

835


What is a callback c#?

947


can multiple catch blocks be executed for a single try statement?

926


How Global.asax is used ?

999


What is sorting in c#?

919


Describe an interface class?

999


What is the process of delegation?

912