and in the second case how can i call the getMessage() method?
…, so it was known then that enum constants are singletons, if you include the version of the singleton which has multiple instances.there is only one instance of each enum constant
Campbell Ritchie wrote:...since singletons have changed from a pattern to an anti‑pattern...
"Il y a peu de choses qui me soient impossibles..."
Ulf Dittmer wrote:That discussion probably goes beyond what is appropriate for the beginner's forum, so I'll just point to Singleton pattern - the "References" section points to some articles on that.
"Il y a peu de choses qui me soient impossibles..."