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
How is mvc different from asp.net? : Asp.Net MVC
How to disable cut, copy and paste in TextBox using jQuery in asp.net?
Which is better session or viewstate?
What is latest version of asp.net mvc? : Asp.Net MVC
What is IPostBack? How to use it?
What are the versions of garbage collection?
How do I know asp.net mvc version? : Asp.Net MVC
How to do parallel database export in remote SQL Server in ESSL time track. It is working for local server but not working for remote SQL Server
What is custom events?
If I am developing an application that must accomodate multiple security levels though secure login and my asp.net web application is spanned across three web-servers (using round-robin load balancing). What would be the best approach to maintain login-in state for the users?
State differences between MVC and WebAPI
What is the difference between WindowsDefaultLocation and WindowsDefaultBounds?
What New Features comes with ASP.NET Web API 2.0?
What is session mode in asp.net?
Differentiate between structure and class.