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

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 (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 ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the correct way of declaring an xml namespace?

816


how to print invert pyramid in c#

1751


What is byte c#?

824


Can you pass parameters to destructors?

1022


How to get the sum of last 3 items in a list using lambda expressions?

917


Is static class thread safe in c#?

929


What is the class in c#?

858


what optimizations does the c# compiler perform when you use the /optimize+ compiler option?

1039


Can constructor have return type c#?

1005


What is namespace in oops?

890


What are the different approaches of passing parameters to a method?

953


What is the difference between a function and a method?

950


How do we achieve encapsulation in c#?

922


How to find out that the code is written as managed or un-managed code?

1077


What is a class c#?

918