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 what is an abstract class?
Let's say I have an existing application written using vb6 and this application utilizes windows 2000 com+ transaction services. How would you approach migrating this application to.net?
How is my content secured from unauthorized access?
How do you deploy your asp.net application?
What are the elements of a website?
Describe the .net base class library.
Describe the master page.
Can we use html in asp.net?
How can we add an event handler for a ASP.NET function executed on MouseOver for a certain button.
What is jade template engine?
Define authentication and authorization.
How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?
How many validators do ASP.NET have?
What are the advantages and disadvantages of Using Cookies?
How Session use Cookies in State Management?