static void Main(string[] args) { MyThread t1 = new MyThread("Thread 1");//create an incstance if the class MyThread MyThread t2 = new MyThread("Thread 2"); MyThread t3 = new MyThread("Thread 3"); t1.startThread();//call the function startThread to start a thread t2.startThread(); t3.startThread(); Console.ReadKey(); }
static void Main(string[] args) { MyThread th1 = new MyThread("Thread1"); MyThread th2 = new MyThread("Thread2"); MyThread th3 = new MyThread("Thread3"); th1.StartThread(); th2.StartThread(); th3.StartThread(); }
static void Main(string[] args) { MyThread t1 = new MyThread("Thread 1"); MyThread t2 = new MyThread("Thread 2"); MyThread t3 = new MyThread("Thread 3"); t1.startThread(); t2.startThread(); t3.startThread(); }
static void Main(string[] args) { MyThread t1 = new MyThread("Thread 1"); //creating objects of "MyThread" class MyThread t2 = new MyThread("Thread 2"); MyThread t3 = new MyThread("Thread 3"); t1.StartThread(); //calling functions to start threads t2.StartThread(); t3.StartThread(); Console.ReadKey(); }
static void Main(string[] args) { MyThread t1 = new MyThread("Thread12"); Console.Read(); }