package singleton; public class SingletonSub extends RegSingleton { // It's the only time and place when // its constructor invokes static { new SingletonSub(); } protected SingletonSub() { // put this subclass in common register with // this class name RegSingleton.Register(this.getClass().getName(), this); } }