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 use of FormBoarderStyle Propertie

884


Is boxing an implicit conversion?

983


What is linq c#?

852


What is part of a method signature in c#?

872


if a method is marked as protected internal who can access it?

999


What is class sortedlist underneath?

907


What is the difference between finalize() and dispose()?

881


What is cls, cts and clr in net?

875


What does args mean in c#?

859


Is datetime value type c#?

829


What are the differences between system.string and system.text.stringbuilder classes?

964


Can constructor be overloaded in c#?

839


What is the difference between an implicit conversion and an explicit conversion?

931


Explain the security with aop?

1016


What is a console file?

904