3
Reply

What is a delegate ?

18y
6.2k
0
Reply

    A Delegate is an object that refers to a subroutine, function, or other method. The method can be an instance method provided by an object, a class’s shared method, or a method defined in a code module. A delegate variable acts as a pointer to a subroutine or function. Delegate’s variables are sometimes called type-safe function pointers. The Delegate keyword defines a delegate class and specifies the parameters and return type of the method to which the delegate will refer.

    C# used function pointer in terms of delegates.

    When run time any event occur then run time shuold know what method it should execute. Runtime pass this to delegate and delegate pass this to proper method.

    A delegate is a generic method/signature that can be used to tie to the events raised by the objects.

    18y
    0