singleton

how can I change the code generated from "new -> Singleton"?

I prefered this implementation due to the bottleneck of using "synchronized":

public class Test {
private static Test ourInstance;

static {
outInstance = new Test();
}

public static Test getInstance() {
return ourInstance;
}

private Test() {
}
}

Please sign in to leave a comment.