摘要:
第一种最简单,但没有考虑线程安全,在多线程时可能会出问题 public class Singleton{ private static Singleton _instance = null; private Singleton(){} public static Singleton CreateInstance() { if(_instance == null) { _instance = new Singleton(); } return _instance; }}第二种考虑了线程安全... 阅读全文
posted @ 2012-04-02 09:39
黄铨
阅读(286)
评论(0)
推荐(0)
浙公网安备 33010602011771号