Last active
August 23, 2016 21:23
-
-
Save leon0399/1750cc9d25d6a828a4101b88e4992339 to your computer and use it in GitHub Desktop.
Singleton
This file contains hidden or 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 final class Singleton { | |
private Singleton() { | |
} | |
public static Singleton getInstance() { | |
return SingletonHolder.HOLDER_INSTANCE; | |
} | |
private static final class SingletonHolder { | |
private static final Singleton HOLDER_INSTANCE = new Singleton(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment