Please note that I have gone through the below thread :
What is an efficient way to implement a singleton pattern in Java?
To summarize, there are important
by glancing at the code (I will look at it more thoroughly hopefully later):
2 is protected because you can't create multiple instances of an enumerated value. INSTANCE is written out...and so when you read it back in, you just cannot create another instance of INSTANCE if it exists. Nice feature of the language :).
Both of those are guaranteed by Java Language specification:
The final clone method in Enum ensures that enum constants can never be cloned, and the special treatment by the serialization mechanism ensures that duplicate instances are never created as a result of deserialization. Reflective instantiation of enum types is prohibited. Together, these four things ensure that no instances of an enum type exist beyond those defined by the enum constants.
More details can be found from http://docs.oracle.com/javase/7/docs/platform/serialization/spec/serial-arch.html#6469 and java.lang.reflect API.
Item 2: The singleton,if serializable, must ensure that de-serialization doesn't create a new instance is guaranteed by specification of enum serialization.
Enum constants are serialized differently than ordinary serializable or externalizable objects. The serialized form of an enum constant consists solely of its name; field values of the constant are not present in the form. To serialize an enum constant, ObjectOutputStream writes the value returned by the enum constant's name method. To deserialize an enum constant, ObjectInputStream reads the constant name from the stream; the deserialized constant is then obtained by calling the java.lang.Enum.valueOf method, passing the constant's enum type along with the received constant name as arguments. Like other serializable or externalizable objects, enum constants can function as the targets of back references appearing subsequently in the serialization stream.
The process by which enum constants are serialized cannot be customized: any class-specific writeObject, readObject, readObjectNoData, writeReplace, and readResolve methods defined by enum types are ignored during serialization and deserialization.
Item 3: In case of a reflection attack, an exception/error must be thrown.
Creating new instances via newInstance method is doomed to fail:
IllegalArgumentException ... if this constructor pertains to an enum type.