Create Instance of Thread - CSharp Thread Asynchronous

CSharp examples for Thread Asynchronous:Thread

Description

Create Instance of Thread

Demo Code

using System;/*from   w  w  w  .j a  v  a2s. c o  m*/
using System.Threading;
class Bank
{
   private string bankName = "First Bank";
   public void WorkerThread( )
   {
      Console.WriteLine("Bank Name = {0}", this.bankName );
   }
   public void Run( )
   {
      Thread WT = new Thread( new ThreadStart( this.WorkerThread ) );
      WT.Start( );
   }
   static void Main(string[] args)
   {
      Bank b = new Bank( );
      b.Run( );
   }
}

Result


Related Tutorials