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
You can do
public enum Singleton { INSTANCE; }
and for a utility class which has no instances
public enum Utility { ; public static void method(); }