标签:null test new public 构造函数 .class zed 变量 instance
public class SingleTest{
//私有构造函数
private SingleTest(){}
//volatile变量
private static Volatile SingleTest instance;
//静态方法
public static SingleTest getInstance(){
if(null==instance){
synchronized (SingleTest.class){
if(instance == null){
instance = new SingleTest();
}
}
}
return instance;
}
}
标签:null test new public 构造函数 .class zed 变量 instance
原文地址:http://www.cnblogs.com/ajfajz/p/7244088.html