摘要: //饿汉式,在多线程下是安全的 public class Single { private static final Single s=new Single(); private Single(){}; public static Single getInstance(){ return s; } } //懒汉式,非线程安全,必须使用同步 pu... 阅读全文
posted @ 2017-01-22 20:32 抡起菜刀砍小强 阅读(237) 评论(0) 推荐(0) 编辑