package Counter;

public class CounterController {

    int counter = 0; // Variable compartida

    private static CounterController cc = null;

    private CounterController() {}

    public synchronized static CounterController getInstance() {
        if (cc == null)
            cc = new CounterController();

        return cc;
    }

    public synchronized int incrementCounter() {
        return ++counter;
    }

}