About delegates ?

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


Please Help Members By Posting Answers For Below Questions

Explain asp.net page life cycle?

615


How long the items in ViewState exists?

968


Demonstrate Render and PreRender?

603


What are the session management techniques asp net?

563


What is a postback ispostback and autopostback in asp net?

481






What are the benefits of view state?

554


What is the use of HttpHandlers? When to use this?

630


Explain the difference between the web config and machine config.

627


Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?

1905


Explain Authentication mechanism in dotnet

630


How can we pass info between 2 asp.net pages?

565


How to communicate via Remote proxy with Client? a)MarshalByRef b)Marshal by Value or Any thing else?

1571


What is meant by server side scripting?

523


How do you change the session time-out value?

583


How does asp net store session ids by default?

534