Program 19.2: ThreadTest

Program 19.2 demonstrates threading in conjunction with the BytePrinter of Program 19.1.

public class ThreadTest {

  public static void main(String args[]) {
  
    BytePrinter bp = new BytePrinter();
    bp.start();
    for (int i = -128; i < 128; i++) {
      System.out.println("Main method: " + i); 
    }
  
  }

}

Copyright 1996 Elliotte Rusty Harold
elharo@sunsite.unc.edu
This Chapter
Examples
Home