Skip to content

Instantly share code, notes, and snippets.

@ByungJun25
Created February 10, 2021 11:28
Show Gist options
  • Save ByungJun25/9b7cc6700731b1c38231a1ba65394730 to your computer and use it in GitHub Desktop.
Save ByungJun25/9b7cc6700731b1c38231a1ba65394730 to your computer and use it in GitHub Desktop.
Singleton boilerplate.
public class SingletonTemplate {
private SingletonTemplate() {
}
public static SingletonTemplate getInstance() {
return SingletonLazyHolder.INSTANCE;
}
private static class SingletonLazyHolder {
private static final SingletonTemplate INSTANCE = new SingletonTemplate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment