Why would one ever want to use a synchronized method in Enum?
https://softwareengineering.stackexchange.com/questions/150115
-
04-11-2019 - |
Question
I stumbled upon this question 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.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange