using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public delegate void MyFirstDelegate(string i);
public delegate void MyFirstDelegate2(int i);
class Program
{
static void Main(string[] args)
{
/*Lambda 表达式运算符"=>",这个
运算符左边是参数,右边是表达式或者语句块。
*/
//还可以添加语句表
MyFirstDelegate2 me = i => { Console.WriteLine(i); };
MyFirstDelegate2 mi=i =>i*i;
MyFirstDelegate my = delegate(string j)
{
System.Console.WriteLine(j);
}; //与Java的匿名类部类相类,这里面叫匿名委托
Console .ReadKey();
}
void Method1(int i, int j)
{
Console.WriteLine(i * j);
}
}
}