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
Explain Optimization technique description?
How to Insert/Add in ASPXgridview
Explain the different types of assemblies?
What is jade template engine?
What can you do with asp.net?
Describe in brief .net framework and its components.
How do you secure your configuration files to be accessed remotely by unauthorized users?
Difference between singleton and singlecall.
Which is better php or asp.net?
Explain what is the procedure to create the environment for asp.net? : asp.net mvc
What is data cache in sql server?
Write some code using interfaces, virtual methods, and an abstract class`
Which method is used to force all the validation controls to run?
Explain the difference between value type and reference type?
How could you modify xaml content from javascript?