|PREV CLASS NEXT CLASS||FRAMES NO FRAMES|
|SUMMARY: NESTED | FIELD | CONSTR | METHOD||DETAIL: FIELD | CONSTR | METHOD|
Classes that implement this interface are Singletons. The class must hold a static instance of the class named
IT should be public, final and initialized by an static call to a constructor. The class should have a private final constructor. The class should also override toString() to return some information about the internal state of IT. Often, the class should be final.
If the Singleton is also Serializable and stateless, it should override readResolve() to return IT, like this:
private Object readResolve()
If the Singleton isn't stateless, you'll need to make decisions about keeping the current state of the singleton or replacing the existing state when deserializing.
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright (c) 2001, 2002, David Walend