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 a delegate?

Answer Posted / sadab alam

Delegate is refrence type varible that holds the refrence
to a method.
There are two type of delegte
1.Sigle cast delegate
2.Multi cast delegate
if delgate variable contains refrence of one method then it
is called sinlecast delegate
and if contains refrence of more than one method then it is
called multicast refrence.

using System;
public delegate void mydel();
class del
{
public static void method1()
{
Console.WriteLine("first method");
}
public static void method2()
{
Console.WriteLine("Second method");

}
public static void Main()
{
mydel d=new mydel(method1);
d+=new mydel(method2);
d();
}
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the name of c# compiler?

1075


What is the purpose of a constructor in c#?

826


What is the file extension for c#?

958


Can partial class be inherited?

861


What is equal c#?

869


How do you serialize an object?

956


Can you declare a field readonly?

875


What is arraylist?

939


Which compiler switch creates an xml file from xml comments in the files in an assembly?

944


What does void do in c#?

896


What do you mean by abstract class in c#?

907


What are instance fields in c#?

959


What can I create with c#?

853


What is default boolean value in c#?

913


What is inner class in c#?

907