奶霸000

导航

单例模式

package newdemo.jeno.designdemo.utlis;

/**
* Created by songjiabin1 on 2016/9/12.
*/
public class Login {
private static Login instance = null;

public static Login getInstance() {
if (instance == null) {
synchronized (Login.class) {
if (instance == null) {
instance = new Login();
}
}
}
return instance;
}

}

posted on 2016-09-12 12:01  奶霸000  阅读(109)  评论(0编辑  收藏  举报