John de Michele wrote:Another possibility to avoid threading issues is creating the singleton as a type-safe enum:
Muhammad Ali Khojaye wrote:I am not sure whether we have any advantage of Enum Singleton pattern over inner class static holder idiom pattern.
Paul Clapham wrote:
If you make your singleton serializable, then you can create as many as you want by deserializing one which has been serialized. But when you deserialize an Enum object, you just get the original Enum, not a copy of it.