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);
}
}
}