System.out.println("Doing calculation of " + p + " in thread " + Thread.currentThread()); return p;
int nThreads = Integer.parseInt(args[0]); for (int i = 0; i < nThreads; i++) { Thread t = new Thread(new CalculatorTest()); t.start(); }
for (int i = 0; i < 30; i++) { Integer p = new Integer(i % 5); calculate(p); }