Android 设计模式——————单列模式——————简单的单列模式在项目中的运用
一、恶汉式/**
* Created by yanbo on 2017/7/7.
* 恶汉试(类加载就初始化)
*/
public class Singleton {
public static Singleton instance = new Singleton();
//提供外界访问的方法
public static Singleton getInstance(){
原创
2017-07-07 17:26:07 ·
357 阅读 ·
0 评论