by dteoh · 15y ago · 0 comments
public enum Singleton {
INSTANCE;
}
Guaranteed against multiple instantiation.Edit: the class version of the singleton example should also be made final, or I could just extend your class and therefore bypass your singleton restriction.