singleton Follow
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.
Choose Options -> File Templates from the menu. There you can change existing templates or add new ones.