Seo Forum

Coding & Programming => Programming Forum => Topic started by: beingchinmay on 11-22-2016, 04:13:12

Title: What is a Delegate?
Post by: beingchinmay on 11-22-2016, 04:13:12
•   Delegate in C# is similar to a function pointer in C or C++.

•   Delegate is type which holds the method(s) reference in an o ject. It is also referred as a type safe function pointers.

•   Delegate allows the programmer to encapsulate a reference to a method inside a delegate object.

•   The delegate object can then be pass d to code which can call the referenced method, without having to know at compile time which m thod will be invok d.

•   An interesting and useful property of a elegate is that it does not know or care about the class of the object that it references.
Title: Re: What is a Delegate?
Post by: saravjeet on 12-13-2016, 23:23:35
A delegate is a reference type variable that holds the reference to a method. The reference can be changed at runtime. Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.