Tag Archives: singleton

[Java] The fastest singleton

Everybody know how to write thread-safe singleton. Consider standard approach: public class Singleton { private static Singleton instance; private Singleton() {} public static synchronized Singleton getInstance() { if(instance == null) { instance = new Singleton(); } return instance; } } … Continue reading

Posted in coding, java, standard edition | Tagged , , , | 5 Comments