/**
* 利用Java的类加载机制,来变相的解决多线程访问的问题。
*
* @author Administrator
*
*/
public class Singleton {
private static class Holder {
private static final Singleton instance = new Singleton();
}
private Singleton() {
}
public static Singleton getInstance() {
return Holder.instance;
}
}