Sunday 3 December 2017

C# Program to Declare and Instantiate Delegates


Code:

using System;
delegate void dele1();
public class Delegateintro
{
    static void Main()
    {
        dele1 del = new dele1(Write);
        del();
    }
    static void Write()
    {
        Console.WriteLine("Calling Write  ");
    }
}


Output:

Calling Write


More C# Programs:


















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...