转载请注明出处:http://blog.csdn.net/crazy1235/article/details/72357219
package android.util.Singleton.java
public abstract class Singleton<T> {
private T mInstance;
protected abstract T create();
public final T get() {
synchronized (this) {
if (mInstance == null) {
mInstance = create();
}
return mInstance;
}
}
}
作者:crazy1235 发表于2017/5/17 10:18:07 原文链接
阅读:123 评论:0 查看评论