public class Counter { private int value; public Counter() { super(); this.value = 0; } public synchronized int increment() { this.value++; return this.value; } public synchronized int decrement() { this.value--; return this.value; } }