using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Delegate
{
class Program
{
delegate int MyDelegate(int a, int b);
static void Main(string[] args)
{
MyDelegate _delegate = (x, y) => x + y;//here simply using linq rather then define method.
int result = _delegate(5, 10);
Console.WriteLine(result);
}
}
}Delegates are used to pass methods as arguments to other methods.