???????????????
?????Alexyz123 ???????[ 2017/3/28 16:28:20 ] ??????????????? ????????
	????д?????
	????д???????????????????ддif else??????????????coding????????????????????????????????????????????????????????????????С???????е???coding??????????????????????????????????????????????д?????????????????д???????????????????????????б?????????????????????????к?????????????????????????????????????????ù??????????????????????????????????????????????????????Щ??????????????????????????????????????????????
	???????弰???
	????????????????????????????????????????????????????£?
	
	
	?????????????????????????????????????????????????????
	??????1?? ?????е??????
	??????2?? ????????????????е???????
	??????3?? ?????????????????е???????
	???????????????????????????α????
	public class Singleton{
	private Singleton(){} //??е??????
	private static Singleton singleton; //?????????????о??????
	public static Singleton getInstance(){ //??????????????о??????
	…… //???????????????????????????о??????
	return singleton;
	}
	}
	????????????????????????????????????????????????????л??????????????????
	//readResolve method to preserve Singleton property
	private Object readResolve() throws ObjectStreamException {
	return INSTANCE;
	}
	//?????????ú????μ?Singleton???
	private static boolean flag = false;
	private Singleton(){
	synchronized(Singleton.class)
	{
	if(flag == false){
	flag = !flag;
	} else{
	throw new RuntimeException("?????????????");
	}
	}
	}
	//???????????μ????
	@Override
	protected Object clone() throws CloneNotSupportedException {
	throw new CloneNotSupportedException("Cannot clone instance of this class");
	}
	?????????????????????????????????????????ó???????????????????????????????????????????
	????√ ?????? —— ?????????????????????
	????√ ?????? —— ??????????????·??????????????????
	????√ ?????? —— ???????????????????????????????
	????????????
	????????????????????????????????????????????Щ???????????????????????б???????????????????????????????????????????????3???????????
	?????? ??????????????????????
	?????? ??????????????????????????????????????????
	?????? ??????????????
	?????? ?????????????????????
	?????? ?????????????????????????????????
	?????????
	???????????????????????????????????????????????????????ж????????????????????????????????????????????????????????????????????????????????????????????
	?????????????
	public class Singleton {
	private static Singleton instance=new Singleton();
	private Singleton(){}
	public static Singleton getInstance(){
	return instance;
	}
	}
	??????????????????????????????????????????JVM?????????????????????????????????????磬?????????????????Lazy Loading???????????????????????????????б??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????б?????????????????????????????????????????????????????
	??????????????????????????????д?????????????????????JVM????????????????????????????£?
	????private static Singleton instance = null;
	????static {
	????instance = new Singleton();
	????}
	?????????????
	?????????????????????????????????????????????????????α??????????????????????????????????????????????????????????????о?????????????????????????????????????????????£?
	public class Singleton {
	private static Singleton instance=null;
	private Singleton() {}
	public static Singleton getInstance(){
	if(instance==null) {
	instance=new Singleton();
	}
	return instance;
	}
	}
	??????????????????????в?????????????????????????????ж??????????getInstance()???????Singleton?????????п?????????????????????п????????????getInstance()???????????????Singleton????????????????????????????????????????????????
	public class Singleton {
	private static Singleton instance=null;
	private Singleton() {};
	public static synchronized Singleton getInstance(){
	if(instance==null){
	instance=new Singleton();
	}
	return instance;
	}
	}
	???????????????getInstance()?????????????????????????????????????????????????????Ч????μ????????????????getInstance()??????????????????????????????????????????????????????????????????????????????????????return????????????????????????????????????????????????н??????Ч??????????(Double Checked Locking)????
	public class Singleton {
	private static volatile Singleton instance=null;
	private Singleton() {}
	public static Singleton getInstance(){
	if (instance == null) {
	synchronized (Singleton.class) {
	if (instance == null) {
	instance = new Singleton();
	}
	}
	}
	return instance;
	}
	}
	???????????????????????????????????????????????????????
	????1???????????????
	?????????????getInstance()???????????μ?? instance == null???????????????????????????????????????????????????Σ??????????ж??????????????????? if??????????????????ж??μ??????????????????
	????2?????????instance???volatile??????к?????
	???????????instance = new Singleton()????????????????????JVM????仰??????????? 3 ?????飺
	?????? ?? instance ???????
	?????? ???? Singleton ?????????????????????
	?????? ??instance??????????????????????? instance ??? null ???
	??????????JVM???????????д??????????????????????????????????????????????????????????????????? ??-??-?? ??????? ??-??-???????????????? ?? ????????? δ?????????????????????? instance ?????? null ????????г???????????????????????? instance????????????????
	
??????
					
					???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44
					
			
								
								
								
								
								
								
								
								
								
								
				
sales@spasvo.com