What is a Delegate?

Author Topic: What is a Delegate?  (Read 1684 times)

Offline beingchinmayTopic starter

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 1
  • Posts: 73
  • Karma: 0
  • Gender: Male
  • I am Chinmay
    • Modular Kitchen Designer
What is a Delegate?
« 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.

Offline saravjeet

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 4
  • Posts: 39
  • Karma: 0
    • Ecommerce Website Builder
Re: What is a Delegate?
« Reply #1 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.


Related Topics

  Subject / Started by Replies Last post
1 Replies
Last post 07-07-2021, 11:07:02
by Lishmalinyjames
1 Replies
Last post 07-07-2021, 11:10:59
by Lishmalinyjames