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 verbatim string literal in c#?

976


Explain the constructor in c#.

1116


If a method's return type is void, can you use a return keyword in the method?

893


What is xslt in c#?

872


What is difference between a function and a method?

943


How many static constructors are allowed in a class?

953


How long does it take to get a loop recorder put in?

861


What is interface c#?

880


Whats an assembly? Describe the importance of assembly?

911


What does writeline mean?

994


Why constructor is used in c#?

916


Explain About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.

1026


Why do we use dataset in c#?

985


What are the namespace level elements?

996


What does immutable mean in c#?

963