While I was studying from the book, I copy this program and try to compile
and did not work.
Please help
/* It start here **/
import java.lang.*;
public class CountDown implements Runnable
{
static int cycles = 10 ;
public static void main(String[] args )
{
int mx = Integer.parseInt( args[0] ) ;
for( int n = 0 ; n < mx ; n++ )
{
Runnable cdown = new CountDown( n );
Thread t = new Thread( cdown );
t.start();
}
}
int myNum ;
CountDown( int n )
{
myNum = n ;
}
public void run()
{
for( int i = cycles ; i >= 0 ; i-- )
{
System.out.println( myNum + " = " + i );
try
{
Thread.sleep( 1000 );
}
catch(InterruptedException e)
{
}
}
}
} // end of the CountDown class
/* end **/