package com.pattern.singleton;

/**
 * 内部类创建实例，维护实例
 * <p/>
 * User : krisibm@163.com
 * Date: 2015/9/7
 * Time: 9:05
 */
public class LazyLoadHolderSingleton {

    private LazyLoadHolderSingleton() {
    }

    //当调用getInstance才会初始化实例
    public static LazyLoadHolderSingleton getInstance() {
        return SingletonHolder.instance;
    }

    //内部类，当加载LazyLoadHolderSingleton类时，该内部类不会被实例化
    public static class SingletonHolder {
        private final static LazyLoadHolderSingleton instance = new LazyLoadHolderSingleton();
    }
}

@@ -44,16 +44,77 @@
 %E5%BB%BA%E5%AE%9E%E4%BE%8B%EF%BC%8C%E7%BB%B4%E6%8A%A4%E5%AE%9E%E4%BE%8B
+.%0A * %E4%BD%BF%E7%94%A8%E5%86%85%E9%83%A8%E7%B1%BB%E7%9A%84%E6%96%B9%E5%BC%8F%E7%BB%B4%E6%8A%A4%E5%AE%9E%E4%BE%8B%EF%BC%8C%E6%97%A2%E4%BF%9D%E8%AF%81%E7%B1%BB%E6%87%92%E5%8A%A0%E8%BD%BD%E7%9A%84%E6%96%B9%E5%BC%8F%EF%BC%8C%E8%BF%98%E4%B8%8D%E7%94%A8%E4%BD%BF%E7%94%A8synchronized%E5%85%B3%E9%94%AE%E5%AD%97%EF%BC%8C%E6%98%AF%E4%B8%80%E7%A7%8D%E6%AF%94%E8%BE%83%E5%AE%8C%E5%96%84%E7%9A%84%E6%96%B9%E5%BC%8F%E3%80%82
 %0A * %3Cp/%3E

update singleton pattern