/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ public class Test { public static void main(String [] argv) { long lb = 1, ub = 1000, max = 500; CountPrimes worker; try { lb = Long.parseLong(argv[0]); ub = Long.parseLong(argv[1]); max = Long.parseLong(argv[2]); } catch (Exception e) { System.err.println("wrong parameters, using defaults"); } worker = new CountPrimes(lb,ub,max); try { worker.start(); worker.join(); } catch (InterruptedException e) { } System.out.println("The intervall " + lb + " <= i < " + ub + " contains " + worker.noOfPrimes + " primes"); } }