class RunUpInt implements Runnable  {
int delay;
String lbl;

RunUpInt( String id, int d ) {
  lbl = id;
  delay = d; ;
}  // end constructor

public void run ()  {
  try  {
    for ( int i = 0; i < 20; i++)  {
      System.out.println ( lbl + ": " + i );
      Thread.sleep ( delay );
    }  // end for
  }  // end try
  catch ( InterruptedException except)  {
    return;
  }  // end catch
}  // end run

public static void main ( String [ ] args )  {
int delay1, delay2;
  if ( args.length == 2 )  {
  delay1 = Integer.parseInt ( args[0] );
  delay2 = Integer.parseInt ( args[1] );
  }  else  {
  delay1 = 10;  // default value
  delay2 = 55;  // default value
  }  // end else

  Runnable thread1 = new RunUpInt ( "Thread 1", delay1 );
  Runnable thread2 = new RunUpInt ( "            Thread 2", delay2 );

  new Thread ( thread1 ).start();
  new Thread ( thread2 ).start();
}  // end main

}  // end RunUpInt
