Skip to content

Instantly share code, notes, and snippets.

@SeonghoonKim
Created August 22, 2012 01:45
Show Gist options
  • Save SeonghoonKim/3421336 to your computer and use it in GitHub Desktop.
Save SeonghoonKim/3421336 to your computer and use it in GitHub Desktop.
Initialize-on-demand holder class idiom - Wikipedia
public class Something {
private Something() {
}
private static class LazyHolder {
private static final Something INSTANCE = new Something();
}
public static Something getInstance() {
return LazyHolder.INSTANCE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment