单例模式 饿汉 懒汉

//饿汉式 class SingleInstance{ private SingleInstance(){//私有化构造方法 } private static SingleInstance s= new SingleInstance();//建立并私有静态的本类对象 public static SingleInstance getSingleInstance(){//定义公有并静态
相关文章
相关标签/搜索