/**
* synchronized 放在普通方法上,內(nèi)置鎖就是當(dāng)前類的實例
* @return
*/
public synchronized int getNext() {
return value ++;
}
/**
* 修飾靜態(tài)方法,內(nèi)置鎖是當(dāng)前的Class字節(jié)碼對象
* Sequence.class
* @return
*/
public static synchronized int getPrevious() {
// return value --;
return 0;
}