Skip to content

Instantly share code, notes, and snippets.

@tqcenglish
Last active November 11, 2016 03:51
Show Gist options
  • Save tqcenglish/11306718 to your computer and use it in GitHub Desktop.
Save tqcenglish/11306718 to your computer and use it in GitHub Desktop.
设计模式-单例
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