naved momin wrote:
1. why Enum is the best way to create singleton ?
desiging a singleton class is not an easy task. you need to consider cloning, servialization, threading etc.. all the effort is done in the Enum.
naved momin wrote:
2. does this statement create creates an instance ?
No, it just assign an existing object to e.
naved momin wrote:
3. In my Enum I have only 2 method from where does I get valueOF(...), values() for free ?
java.lang.Enum