Fork me on GitHub

匿名方法

所有用到委托的地方都可以用到匿名方法

主线程

static void Main(string[] args)
        {
            StartTread();
            Console.ReadLine();
        }
        private static void StartTread()
        {
            System.Threading.Thread t1 = new System.Threading.Thread(
                delegate ()
                {
                    Console.Write("Hello,  ");
                    Console.WriteLine("World!");
                }
                );
            t1.Start();
        }

匿名方法的参数不能带ref,out

posted @ 2015-06-08 11:12  乔闻  阅读(160)  评论(0编辑  收藏  举报