Ray's playground

 

Advanced C#(Chapter 4 of C# 4.0 in a nutshell)

Lambda
 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 
 6 namespace ConsoleApplication4
 7 {
 8     class Program
 9     {
10         static void Main(string[] args)
11         {
12             int factor = 2;
13 
14             Func<intint> multiplier = n => n * factor;
15             Console.WriteLine(multiplier(5));
16 
17             Console.Read();
18         }
19     }
20 }

 

posted on 2010-06-01 09:06  Ray Z  阅读(186)  评论(0编辑  收藏  举报

导航