Skip to content

Instantly share code, notes, and snippets.

@agustarc
Created December 22, 2016 00:23
Show Gist options
  • Save agustarc/15ca7098e75dcafe065f341a84b6f97d to your computer and use it in GitHub Desktop.
Save agustarc/15ca7098e75dcafe065f341a84b6f97d to your computer and use it in GitHub Desktop.
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