Last active
November 11, 2016 03:51
-
-
Save tqcenglish/11306718 to your computer and use it in GitHub Desktop.
设计模式-单例
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 class SingletonClass { | |
private static class SingletonClassInstance { | |
private static final SingletonClass instance = new SingletonClass(); | |
} | |
public static SingletonClass getInstance() { | |
return SingletonClassInstance.instance; | |
} | |
private SingletonClass() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment