共计 292 个字符,预计需要花费 1 分钟才能阅读完成。
懒汉式单例
public class RecommendPresenter {private RecommendPresenter() { }
private static RecommendPresenter sInstance = null;
/**
* 获取单例对象
* @return
*/
public static RecommendPresenter getInstance() {if (sInstance == null) {synchronized (RecommendPresenter.class) {if (sInstance == null) {sInstance = new RecommendPresenter();
}
}
}
}
}
正文完