Method 1
public static synchronized Database getInstance(){
if(INSTANCE == null){
INSTANCE = new Database();
}
return INSTANCE;
}
Method 2
private static final Database INSTANCE = new Database();
public static Database getInstance(){
return INSTANCE;
}
Which is the better choice ?