I understand that double locking in Java is broken, so what are the best ways to make Singletons Thread Safe in Java? The first thing that springs to my mind is:
Josh Bloch recommends 2 solutions:
1) worser:
class Singleton { public static Singleton instance = new Singleton(); ... }
2) better:
public enum Singleton { INSTANCE; ... }