代码如下:
using System;
using System.Threading;
class Class1
{
   public void Method1()
   {
      Console.WriteLine("Method1 is the starting point of execution of the thread");
   }
   public static void Main()
   {
      Class1 newClass = new Class1();
      Thread Thread1 = new Thread(new ThreadStart(newClass.Method1));
      Thread1.Name = "Sample Thread";
      Thread1.Start();
      Console.WriteLine("The execution of Sample Thread has started.");
      Thread1.Abort();
   }
}单步执行到Console.WriteLine("The execution of Sample Thread has started.");后立即同时输出两行
Method1 is the starting point of execution of the thread
The execution of Sample Thread has started问题是 Console.WriteLine("The execution of Sample Thread has started.");该行代码是怎样实现对method1的调用的呢?请各位赐教

解决方案 »

  1.   

    Thread1.Start(); //这句已经在调用了
    Console.WriteLine("The execution of Sample Thread has started."); //不关这句的事
      

  2.   

    Thread1.Start(); 这句话调用的Console.WriteLine("Method1 is the starting point of execution of the thread"); Console.WriteLine("The execution of Sample Thread has started."); 只是输出。
      

  3.   

    new ThreadStart(newClass.Method1) 这句指明了线程开始时,要执行的东西。
    Thread1.Start();  开始执行。