public class NumberMachine {
private NumberManager commanManager;
private NumberManager expressManager;
private NumberManager vipManager;
public NumberManager getCommanManager() {
return commanManager;
}
public NumberManager getExpressManager() {
return expressManager;
}
public NumberManager getVipManager() {
return vipManager;
}
//单例模式的代码解释
private NumberMachine(){
}
public static NumberMachine getInstance(){
return Instance;
}
public static NumberMachine Instance=new NumberMachine();
}
|