FileDocCategorySizeDatePackage
SimpleThread.javaAPI DocExample3000Mon Apr 06 18:10:22 BST 1998None

SimpleThread

public class SimpleThread extends Thread

Fields Summary
private int
countDown
private int
threadNumber
private static int
threadCount
Constructors Summary
public SimpleThread()

    
    threadNumber = ++threadCount;
    System.out.println("Making " + threadNumber);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    for(int i = 0; i < 5; i++)
      new SimpleThread().start();
    System.out.println("All Threads Started");
  
public voidrun()

    while(true) {
      System.out.println("Thread " + 
        threadNumber + "(" + countDown + ")");
      if(--countDown == 0) return;
    }