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 and how can this be done ?

Answer Posted / rashid

Overloading is the process of call the same method with
different parameter types,diferent order of parameters with
in the class.Its also applicable for the constructor.

here i give some example

class sample
{
public void display()
{
Console.WriteLine("display :1");
}
public void display(int i,int j)
{
int s=0;
s = i+j;
Console.WriteLine("Result :"+s);
}
}

class Overload
{
public static void Main(string []args)
{
sample s = new sample();
s.display();
s.display(5,5);
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is string nullable in c#?

942


What are the ways in which client can create object on server in cao model?

956


What is c# commonly used for?

863


Why can't we use a static class instead of singleton?

862


What is difference between hashtable and dictionary in c#?

935


How do you escape in c#?

917


What is the difference between function and method in c#?

886


Can list contain duplicates c#?

869


What is ienumerable <> in c#?

885


What is threading in c# with example?

900


Explain attributes in c#?

821


What is a generic method?

947


What is a sealed class?

916


How many constructor can a class have?

983


What are the 3 elements of delegation?

948