В этой базовой c реализации Singleton, когда происходит вызов new Singleton1()
(отмечен *
?
public final class Singleton1 {
private Singleton1() { }
private static Singleton1 instance = new Singleton1(); // (*) When does this happen?
// Before calling getInstance() from the client?
public static Singleton1 getInstance() {
return instance;
}
}