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 are delegates? How you used then in your project?

Answer Posted / prashanth

Delegate means function pointer.
There are two types of delegate
1-simple delegate
2-multicast delegate.

for simple ex:

private void Page_Load(object sender, System.EventArgs e)
{
Label2.Text= DoAction(new Action(Add)).ToString();
Response.Write ("<BR>");
Label3.Text= DoAction(new Action(Sub)).ToString();
//
// // Put user code to initialize the page here
}

static int DoAction(Action action)
{
return action(5,2);
}
public int Add(int n,int m)
{
return n+m;
}
public int Sub(int n,int m)
{
return n-m;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main usage of keyword “virtual” ? How does it work for a method or property?

918


What is master page in asp net c#?

901


There were a lot of questions asked, so I will list the topic (and add a what is "topic" and know pros/cons). Extreme programming, what is a transaction, various SDLC design approaches, what is a namespace, define a good test case, what is a stored proc, webservice? design patterns? linker? compiler? access modifiers? stack vs. queue? arrays vs. linked lists? sorting algorithms? recursion? OOP principles?

2025


How to implement an object pool in c#.net.

1055


Explain synchronous and asynchronous operations?

998


What are different types of classes in c#?

903


Are string objects mutable or immutable?

934


List down the differences between public, static and void keywords?

870


What is a .exe extension files? How is it similar to .dll extension files?

1043


how dot net compiled code will become platform independent?

937


Can dictionary have duplicate keys c#?

875


Why we use anonymous methods in c#?

949


How long has c# been around?

992


What is Implementation inheritance

972


Define c# and list the features.

1009