public class Singleton {
public static Singleton getInstance() {
return theInstance;
}
protected Singleton() {
// initializing instance fields
}
private static Singleton theInstance = new Singleton();
// instance fields and methods
}