单例模式
1)静态的私有的成员变量
2)私有的构造方法
3)公共的静态的入口点方法
1)静态的私有的成员变量
2)私有的构造方法
3)公共的静态的入口点方法
public class SingleModel(){
private static SingleModel instance= new SingleModel();
private SingleModel(){}
public static SingleModel getInstance(){
return instance;
}
}