Created
December 22, 2016 00:23
-
-
Save agustarc/15ca7098e75dcafe065f341a84b6f97d to your computer and use it in GitHub Desktop.
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 Singleton { | |
private Singleton() {} | |
public static Singleton getInstance() { | |
return LazyHolder.INSTANCE; | |
} | |
private static class LazyHolder { | |
private static final Singleton INSTANCE = new Singleton(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment