匿名方法

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

主线程

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

原文地址:https://www.cnblogs.com/handsomer/p/4560423.html