Delegate

using System;

using System.Collections.Generic;


using System.Text;



namespace param_parameter
{
    delegate int delegate1(int x, int y);
    class Program
    {
        
        static int F1(int a, int b)
        {
            return (a + b);
        }
        static int F2(int a, int b)
        {
            return (a - b);
        }
        static void Main(string[] args)
        {
            delegate1 d = new delegate1(Program.F1);
            int r = d(100, 200);
            Console.WriteLine(r.ToString());
            Console.ReadLine();

        }

    }

}

Ebook Download
View all
Learn
View all