About delegates ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sridevi
Delegates are like function pointer in c++ with type-safe.
They can be used in 2 situations
1. callback methods
2. eventHandler
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ravindra
delegate is a reference type which is used to encapsulate a
method with specific signature.
delegates are 2 types
1.single cast delegate
2.multi caste delegate.
Adv:
1.it will improve the performance of the application.
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / payal
Delegate hold reference to another function or method
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / amit kumar
delegates holds the reference of the function
then you can call that function through the delegate object
main benifit of delegate is that you can make difference
between class objects
you can assign the different -2 methods to different-2
object of same class
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / guest
these are just reference to the methods and delegates are
used at the bottom of events.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / prithviraj p
Delegate is a strongly typed function pointer. A delegate
object encapsulates a reference to a method
Is This Answer Correct ? | 0 Yes | 1 No |
Why mvc is faster than asp.net? : Asp.Net MVC
Is redux flux?
What is the latest version of asp.net?
Which is faster viewbag or viewdata?
difference between Trace and Debug ?
2 Answers Accenture, HCL, Patni,
What method must be overridden in a custom control? a) The Paint() method b) The Control_Build() method c) The Render() method d) The default constructor
1 Answers Icertis, Microsoft, Syntax Softtech,
What’s the difference between Response.Write() andResponse.Output.Write()?
What is Hybrid dictionary
Differentiate between Server.Transfer and Response.Redirect with functionality? Why we can choose one over the other?
What are the different Key TreeView Properties in Asp.net 2.0?
Suggest 3 best practices in detail for for Developing High Performance Web and Enterprise Applications
What tags do you need to add within the asp:datagrid tags to bind columns manually?