Example #1
0
        static void Main(string[] args)
        {
            Delegate1       dl = new Delegate1();
            DelegateMethod1 dm = new DelegateMethod1(dl.Test);//first way to call the method by using delegates

            dm();
            DelegateMethod1 dm1 = new DelegateMethod1(dl.Test1);

            dm1();
        }
        static void Main(string[] args)
        {
            Delegate1       dl = new Delegate1();
            DelegateMethod2 dm = dl.Test;//Second way to call the method by using delegates

            dm.Invoke();
            DelegateMethod2 dm1 = dl.Test1;

            dm1();
        }