Answer Posted / naren
1. Delegates holds reference to a method
2. Delegates are objects which points towards a function
which matches its signature
3. Delegates are reference type used to encapsulate method
with specific signature
4. Delegates are typesafe and secure
//declaring a delegate
delegate void SampleDelegate(string message)
//declaring delegate with same signature
static void SampleDelegateMethod(string message)
{
console.writeline(message);
}
//creating delegate method
SampleDelegate d1 = new SampleDelegateMethod();
//invoking method
d1(message);
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What is application in asp net?
What is difference between rest and soap?
Please briefly explain the usage of global.asax?
Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?
How can we inherit a static member?
What are triggers of an updatepanel?
Can a master page have more than one contentplaceholder?
Explain MVC model binders?
Where is the view state data stored?
What are the advantages of using Master Pages?
What is the difference between dynamic SGA and static SGA?
In What Order Do The Events Of An Aspx Page Execute. As A Developer Is It Important To Undertsand These Events?
What is server infrastructure & server components?
List some of the important session state modes of asp.net.
what is publisher?