public class DecrementCounter implements Runnable { private CounterMonitor monitor; private final int MAX_COUNT = 10000; private static int nr = 0; private int threadNr; public DecrementCounter(CounterMonitor m) { monitor = m; nr++; threadNr = nr; } @Override public void run() { for (int i = 0; i < MAX_COUNT; i++) { monitor.decrementCounter(); System.out.println("D-Thread " + threadNr + ": " + monitor.getCounter()); } System.out.println(threadNr + " Done!"); } }