真泰網

Double

Double

1. 以下就是java世界老幼皆知的double check方法 public static Singleton getInstance() { if (instance == null) { synchronized(Singleton.class) { //1 if (instance == null) //2 instance = new Singleton();...