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
What you mean by inner exception in c#?
Why would you use untrusted verification?
Explain the role of the datareader class in ado.net connections?
What is a cs file?
Explain About remoting and web services. Difference between them
What is the use of xmlserializer?
Define a strong name in .net?
What is serializable in c#?
What is escape sequence in c#?
What is difference between singleton and static class in c#?
What is dll in c#?
Is array ienumerable c#?
Explain concurrency with aop?
Can you see a loop recorder?
You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?