Skip to content

Instantly share code, notes, and snippets.

@TonnyXu
Created March 1, 2010 08:47
Show Gist options
  • Save TonnyXu/318214 to your computer and use it in GitHub Desktop.
Save TonnyXu/318214 to your computer and use it in GitHub Desktop.
public enum Singleton6{
INSTANCE;
private Object s = new Object();
// Invoke this like
// Singleton6.INSTANCE.doSomething();
public Object doSomething(){
return s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment