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 the difference between localization and globalization?
Describe Segmentation With Paging?
Which namespace is used by ado.net?
Explain swagger components.
What is the full meaning of asp.net?
How to create discussion forum in asp.net mvc? : Asp.Net MVC
Explain how can we inherit a static variable?
explain code with multi inhertance
Explain managed code an un-managed code.
What is the parent class of all the web server control?
What are the ways of preserving data on a Web Form in ASP.NET?
Explain the steps needed to be performed in order to create an animation in xaml?
What is the use of express session?
What is the use of HttpHandlers? When to use this?
What do you understand by aggregate dependency?