C#3.0 新特性系列(7) Lambda Expressions
A lambda expression is an anonymous funtion that can contain expressions and statements,
1 class Program
2 {
3 delegate int del(int i);
4
5 static void Main(string[] args)
6 {
7 del myDel = x => x * x;
8 int b = myDel(10);
9 }
10
11 }
2 {
3 delegate int del(int i);
4
5 static void Main(string[] args)
6 {
7 del myDel = x => x * x;
8 int b = myDel(10);
9 }
10
11 }