I stumbled upon this questionquestion and a couple of other along the same lines.
While we know creation of enum is thread safe and enums
are by birth singletons .
It kind of confuses me that why would any one want to have a synchronized
method with in an enum
. Yes I am fully aware that methods in an enum
are not thread safe but then what?
They must not try to change the state of an enum any way . If we are not concerned about change of state of an enum then why would we ever like a method in an enum to be thread safe.