getinstance方法(转)

getinstance方法

https://www.cnblogs.com/roadone/p/7977544.html

 //实例化

 public static DBConnect instance;

 public static DBConnect getInstance(){

  if(instance == null){

   instance = new DBconnect();

  }

  return instance;

 }

posted @ 2020-04-23 14:57  wenna-  阅读(356)  评论(0编辑  收藏  举报