You are viewing a single comment's thread. Return to all comments →
Guys, why did my solution with static holder class had some weird assertion? It's definetely the best singleton implementation for Java:
class Singleton { private Singleton() {} public static Singleton getInstance() { return SingletonHolder.INSTANCE; } private static class SingletonHolder { public static final Singleton INSTANCE = new Singleton(); } }
Java Singleton Pattern
You are viewing a single comment's thread. Return to all comments →
Guys, why did my solution with static holder class had some weird assertion? It's definetely the best singleton implementation for Java: