方法1
public static synchronized Database getInstance(){
if(INSTANCE == null){
INSTANCE = new Database();
}
return INSTANCE;
}
方法2
private static final Database INSTANCE = new Database();
public static Database getInstance(){
return INSTANCE;
}
哪个是更好的选择?