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 delegates & multicast delegate?

Answers were Sorted based on User's Feedback



What is delegates & multicast delegate?..

Answer / neerajtyagi

delegate void Del(string s);

class TestClass
{
static void Hello(string s)
{
System.Console.WriteLine(" Hello, {0}!", s);
}

static void Goodbye(string s)
{
System.Console.WriteLine(" Goodbye, {0}!", s);
}

static void Main()
{
Del a, b, c, d;

// Create the delegate object a that references
// the method Hello:
a = Hello;

// Create the delegate object b that references
// the method Goodbye:
b = Goodbye;

// The two delegates, a and b, are composed to form
c:
c = a + b;

// Remove a from the composed delegate, leaving d,
// which calls only the method Goodbye:
d = c - a;

System.Console.WriteLine("Invoking delegate a:");
a("A");
System.Console.WriteLine("Invoking delegate b:");
b("B");
System.Console.WriteLine("Invoking delegate c:");
c("C");
System.Console.WriteLine("Invoking delegate d:");
d("D");
}
}


// Output will be

Invoking delegate a:
Hello, A!
Invoking delegate b:
Goodbye, B!
Invoking delegate c:
Hello, C!
Goodbye, C!
Invoking delegate d:
Goodbye, D!

Is This Answer Correct ?    15 Yes 2 No

What is delegates & multicast delegate?..

Answer / penchal das

Delegate is method which is used to call a method number of
times..

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Sharp Interview Questions

What is wpf application in c#?

0 Answers  


What is difference between ienumerable and iqueryable in c#?

0 Answers  


Will finally block get executed if the exception had not occurred?

2 Answers  


What is Inheritance in C#?

1 Answers   B-Ways TecnoSoft,


How does yield return work c#?

0 Answers  


What is call back method?

0 Answers  


What is definition in c#?

0 Answers  


who is a protected class-level variable available to?

0 Answers   Siebel Systems,


What are the two kinds of properties in c#.

0 Answers  


List down the commonly used types of exceptions in .net

0 Answers  


what is meant inheritance. can you exaplain what kind inhertance ussed in your project

1 Answers  


What is a delegate how is it type safe?

0 Answers  


Categories