C#中的单例模式

namespace collertion{

  public class Collertion{
    private static Collertion collertion;     private Collertion(){
    }

    public static collertion getInstance(){
      if(collertion==null){
        collertion =
new collertion();
      }
      return collertion;
    }
  } }

 

posted @ 2017-03-01 17:36  老猫儿  阅读(164)  评论(0编辑  收藏  举报