java 单例模式

参考:http://blog.csdn.net/kufeiyun/article/details/6166673

private static Single instance = null
public synchronized static Single getInstance(){   
if(instance==null){
instance = new Single();
}
}
private static Single instance = new Single();
public static Single getInstance(){
return instance;
}

 

posted on 2015-04-20 18:32  wjw334  阅读(81)  评论(0编辑  收藏  举报

导航