public class SynchronizedIncrement implements Runnable { private static final int NUM_THREADS = 4; private static final int NUM_INCREMENTS = 10000; private Counter counter; public SynchronizedIncrement(Counter counter) { this.counter = counter; } public static void main(String[] args) throws InterruptedException { Thread[] threads = new Thread[NUM_THREADS]; Counter counter = new Counter(); for (int i=0; i