// Copyright © 2002 // John M. Thompson // Boulder, Colorado USA // jt@iwaypublishing.com // http://www.iwaypublishing.com // // A limited right to copy this page for // individual (non-commercial) educational // use only is hereby granted. import java.io.*; public class multithreading { /** * Usage (Windows): >java -classpath . multithreading * * @param args Array of parameters passed to the application * via the command line. */ public static void main( String[] args ) throws InterruptedException, IOException { sampleThread one = new sampleThread( "One", 4000 ); one.start(); sampleThread two = new sampleThread( "Two", 2500 ); two.start(); one.join(); two.join(); System.out.println( "\nAll threads are done." ); System.out.println( "Press " ); byte[] response = new byte[256]; System.in.read( response ); } }