/***
 * A tiny application to demonstrate Threads
 * by passing two objects which implement the Runnable
 * interface into the constructor of two threads.
 * 
 * @author Mitch Fincher
 *
**/

public class ThreadExample3 implements Runnable {
Thread thread = null;
String name = null;

public ThreadExample3 (String name)
    {
	this.name = name;
    }

public void run()
    {
	int i=0;
	System.out.println("ThreadExample3 run(): ");
	while(i < 10)
	    {
		System.out.print(" "+name+i++);
		try{Thread.sleep(1000);}catch(Exception e){}
	    }
    }

public static void main(String argv[])
  {
      System.out.println("ThreadExample3.main() ");
      ThreadExample3 threadExample3a = new ThreadExample3("a");
      threadExample3a.thread = new Thread(threadExample3a);
      threadExample3a.thread.start();
      ThreadExample3 threadExample3b = new ThreadExample3("b");
      threadExample3b.thread = new Thread(threadExample3b);
      threadExample3b.thread.start();
  }
} // class ThreadExample3
