Today in my interview one interviewer asked me to write a Singleton class. And i gave my answer as
public class Singleton { private static Singleton re
The Singleton I'd write would look like this:
@Service class PersonService { // implementation here }
But I also like the enum ideas. In reality, I never write (nor need) a Singleton other than one like the one above.