class ThreadTest
   { 
     static void Main() { 
     Thread t = new Thread (WriteY); 
     t.Start();                          
     while (true) Console.Write ("x");   
   } 
   
  static void WriteY() 
    { 
        while (true) Console.Write ("y");   
    } 
}红色部分,Thread的构造函数,参数不是一个委托实例吗?怎么能够直接写方法名呢?
恐怕还是应该有区别吧?

解决方案 »

  1.   

    应该是syntax sugar,编译器帮你做了些事情。
      

  2.   

    是ParameterizedThreadStart委托的机制
      

  3.   

    这个叫做Named MethodA delegate can be associated with a named method. When you instantiate a delegate by using a named method, the method is passed as a parameter, for example:
    // Declare a delegate:
    delegate void Del(int x);// Define a named method:
    void DoWork(int k) { /* ... */ }// Instantiate the delegate using the method as a parameter:
    Del d = obj.DoWork;
    来自:
    http://msdn.microsoft.com/en-us/library/98dc08ac.aspx
      

  4.   

    方法名在这里就是委托实例前提是方法签名和委托签名要一致也可以这样Thread t = new Thread (_=>
      {  
         while (true) Console.Write ("y");   
      });