b
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LambdaTest
{
class Program
{
delegate int TwoIntDelegate(int x, int y);
private static void Calculate(int x, int y, TwoIntDelegate calculator)
{
Console.WriteLine(calculator(x, y));
}
static void Main(string[] args)
{
Calculate(1, 2, delegate(int x, int y) { return x + y; });
Calculate(1, 2, (x, y) => x + y);
}
}
}
posted @
2009-09-16 20:25
-==NoWay.==-
阅读(
193)
评论()
编辑
收藏
举报
c