Skip to content

Instantly share code, notes, and snippets.

@mschuetz
Created July 15, 2010 17:31
Show Gist options
  • Save mschuetz/477241 to your computer and use it in GitHub Desktop.
Save mschuetz/477241 to your computer and use it in GitHub Desktop.
public class Singleton {
private static Singleton inst;
public static synchronized Singleton getInstance() {
if (inst==null)
inst = new Singleton();
return inst;
}
private Singleton() {
System.out.println("Singleton ctor");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment