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 a callback c#?

984


Why do we use Design Pattern in C#?

1009


What is string pool in c#?

970


Define a jagged array in c#?

888


How does c# generics and c++ templates compare?

901


Is c# a technology?

892


What is lazy loading c#?

1014


Do loops c#?

863


What is difference between singleordefault and firstordefault?

895


How many types of constructors are there?

873


explain the nature of the assembly work?

2536


What is as keyword in c#?

966


What is the use of table aliases?

895


How can we make a thread sleep for infinite period ?

992


Define using statement in c#?

917