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...
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.
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
how do I do my own kindle-like thing - without amazonhttps://coderanch.com/t/711421/engineering/kindle-amazon