Skip to content

Instantly share code, notes, and snippets.

/**
* see http://caterpillar.onlyfun.net/Gossip/DesignPattern/SingletonPattern.htm
* http://www.jackforfun.com/2007/07/java-synchronized.html
*/
public class Singleton {
private static Singleton instance = null;
private Singleton(){}
public static Singleton getInstance() {
if (instance == null){
synchronized(Singleton.class){
@doubledouble
doubledouble / gist:1803350
Created February 11, 2012 18:06
java_code
public class Test{
public String a = "hello";
}
@doubledouble
doubledouble / 做有意义的事
Created February 11, 2012 17:50
first begining
<h1>发觉自己的爱好!做有意义的事,倾听</h1>