Created
February 10, 2021 11:28
-
-
Save ByungJun25/9b7cc6700731b1c38231a1ba65394730 to your computer and use it in GitHub Desktop.
Singleton boilerplate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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