Mar 24, 2017

Design Pattern: Singleton

class Singleton {
    private static final Singleton ourInstance = new Singleton();

    static Singleton getInstance() {
        return ourInstance;
    }

    private Singleton() {
    }
}

No comments:

Post a Comment