馃崁1.synchronized鐨勪紭鍖栨墜娈?/h2>
馃崅1.1閿佽啫鑳€/鍗囩骇
鍓嶉潰鎴戜滑璇磋繃synchronized鍏抽敭瀛楀姞鐨勯攣鏃㈡槸杞婚噺绾ч攣涔熸槸閲嶉噺绾ч攣锛屽畠鏄牴鎹疄闄呮儏鍐佃嚜閫傚簲鍔犻攣鐨勶紝杩欑鑷€傚簲鏄熀浜庨攣鑶ㄨ儉鎴栬€呰鏄攣鍗囩骇杩欐牱鐨勪紭鍖栨墜娈垫潵瀹炵幇鐨勩€?/p>
馃尭閿佸崌绾ц繃绋嬶細
- 褰撴病鏈夌嚎绋嬪姞閿佺殑鏃跺€欙紝姝ゆ椂涓烘棤閿佺姸鎬併€?/li>
- 褰撻涓嚎绋嬭繘琛屽姞閿佺殑鏃跺€欙紝姝ゆ椂杩涘叆鍋忓悜閿佺殑鐘舵€侊紝鍋忓悜閿佷笉鏄湡鐨勫姞閿侊紝鑰屾槸鍦ㄥ璞″ご鍋氫釜鏍囪鑰屽凡锛?/li>
- 褰撴湁鍏朵粬绾跨▼杩涜鍔犻攣锛屽鑷翠骇鐢熶簡閿佺珵浜夋椂锛屾鏃惰繘鍏ヨ交閲忕骇閿佺姸鎬併€?/li>
-
濡傛灉绔炰簤杩涗竴姝ュ姞鍓э紝杩涘叆閲嶉噺绾ч攣鐘舵€併€?/p>
鍍忎笂闈㈡牴鎹攣绔炰簤鐨勭▼搴︽潵閫愭鍗囩骇閿佺殑鎯呭喌锛屽氨鏄攣鐨勮啫鑳€鎴栬€呯О涓洪攣鐨勫崌绾с€?/p>
馃崅1.2閿佺矖鍖?/h2>
鎵€璋撻攣绮楀寲灏辨槸灏?code>synchronized鐨勫姞閿佷唬鐮佸潡鑼冨洿澧炲ぇ锛屽姞閿佺殑浠g爜鍧椾腑鐨勫唴瀹硅秺澶氾紝閿佸氨瓒婄矖锛屽惁鍒欓攣灏辫秺缁嗐€?br> 涓€鑸垜浠涓猴紝閿佽秺缁嗭紝澶氱嚎绋嬮棿鐨勫苟鍙戞€ц秺楂橈紝閿佽秺绮楋紝鍔犻攣瑙i攣鐨勫紑閿€灏变細鏇村皬銆傜紪璇戝櫒浼氬浣犲姞鐨勯攣鍋氫竴涓紭鍖栵紝濡傛灉缂栬瘧鍣ㄥ垽瀹氬姞鐨勯攣杩囩粏锛屽氨浼氳嚜鍔ㄧ矖鍖栵紝浠庤€屾彁楂樼▼搴忚繍琛屾晥鐜囥€?/p>
馃崅1.3閿佹秷闄?/h2>
鏈変簺浠g爜锛岀紪璇戝櫒璁や负娌℃湁鍔犻攣鐨勫繀瑕侊紝灏变細鑷姩鎶婁綘鍔犵殑閿佽嚜鍔ㄥ幓闄わ紝鍍忕被浼艰繖鏍风殑浼樺寲锛屽氨鏄攣娑堥櫎銆?/p>
馃崁2.java涓殑JUC
java涓殑JUC灏辨槸鏉ヨ嚜java.util.concurrent
鍖呬笅鐨勪竴浜涙爣鍑嗙被鎴栬€呮帴鍙o紝閮芥槸鏈夊叧骞跺彂鎴栬€呮湁鍏冲绾跨▼鐨勪竴浜涚被鍜屾帴鍙c€?/p>
馃崅2.1Callable鎺ュ彛
鍓嶉潰鎴戜滑鍒涘缓绾跨▼鐨勬椂鍊欙紝鏈変袱绉嶆柟寮忥紝涓€鏄户鎵?code>Thred绫诲苟閲嶅啓run
鏂规硶鏉ュ垱寤虹嚎绋嬶紝浜屾槸閫氳繃Runnable
鎺ュ彛鏉ュ垱寤虹嚎绋嬶紝闄や笂杩颁袱绉嶆柟寮忥紝鎴戜滑杩樺彲浠ラ€氳繃Callable
鎺ュ彛閰嶅悎FutureTask
绫绘潵鍒涘缓绾跨▼锛屼娇鐢ㄨ鏂规硶鍒涘缓绾跨▼鑳藉鏀寔甯﹁繑鍥炲€肩殑浠诲姟锛岃€屾渶寮€濮嬬殑閭d袱绉嶆柟娉曟槸涓嶆敮鎸佸甫鍥炶繑鍥炲€肩殑銆?/p>
鍏朵腑閫氳繃瀹炵幇Callable
鎺ュ彛鐨?code>call鏂规硶鏉ユ弿杩板甫鏈夎繑鍥炲€肩殑浠诲姟锛?code>FutureTask灏辨槸瀵逛簬鍏蜂綋鐨?code>Runnable鎴栬€?code>Callable浠诲姟鐨勬墽琛岀粨鏋滆繘琛屽彇娑堛€佹煡璇㈡槸鍚﹀畬鎴愩€佽幏鍙栬繑鍥炲€笺€傚繀瑕佹椂鍙互閫氳繃get
鏂规硶鑾峰彇鎵ц缁撴灉锛堣繑鍥炲€硷級锛屽鏋滀换鍔¤繕娌℃湁鎵ц瀹屾瘯锛岃鏂规硶浼氶樆濉炵洿鍒颁换鍔¤繑鍥炵粨鏋溿€?/p>
鍦ㄥ垱寤虹嚎绋嬬殑鏃跺€欙紝浼犲叆鐨勫紩鐢ㄤ笉鑳芥槸Callable
绫诲瀷锛岃€屽簲璇ユ槸FutrueTask
绫诲瀷锛屾牴鎹?code>Thread鐨勬瀯閫犳柟娉曪紝浼犲叆鐨勪换鍔$被鍨嬮渶鏄?code>Runnable绫伙紝Callable
涓?code>Runnable娌℃湁鍏崇郴锛岃€?code>FutrueTask绫诲疄鐜颁簡Runnable
绫伙紝鎵€浠ュ湪姝や箣鍓嶆垜浠渶瑕佹妸瀹炵幇Callable
鎺ュ彛鐨勫璞″紩鐢ㄤ紶缁?code>FutrueTask绫荤殑瀹炰緥瀵硅薄銆?[鍥剧墖涓婁紶涓?..(image-c0aaa5-1654604115299-4)]
缁间笂锛?code>Callable鐢ㄦ潵鎻忚堪浠诲姟锛?code>FutureTask绫荤敤鏉ョ鐞?code>Callable浠诲姟鐨勬墽琛岀粨鏋溿€?/p>
姣斿锛岀幇鍦ㄦ垜浠渶瑕佷娇鐢ㄧ嚎绋嬫潵璁$畻涓€涓€硷紝骞堕€氳繃杩斿洖鍊肩殑鏂瑰紡鑾峰彇鎵ц缁撴灉銆?/p>
馃尭鍙傝€冧唬鐮侊細
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
public class Main {
public static void main(String[] args) throws ExecutionException, InterruptedException {
Callable<Integer> callable = new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return 100 * (1 + 100) / 2;
}
};
FutureTask<Integer> task = new FutureTask<>(callable);
Thread thread = new Thread(task);
thread.start();
//鑾峰彇鎵ц缁撴灉
System.out.println(task.get());
}
}
馃尭杩愯缁撴灉锛?/p>
5050
Process finished with exit code 0
馃崅2.2ReentrantLock绫伙紙鍙噸鍏ラ攣锛?/h2>
ReentrantLock
鍏跺疄灏辨槸鍙噸鍏ラ攣锛屼娇鐢ㄦ柟寮忔槸閫氳繃lock
鏂规硶鍔犻攣锛?code>unlock鏂规硶瑙i攣锛屾敞鎰忓姞閿佸拰瑙i攣涓や釜杩囩▼鏄垎寮€鐨勶紝鑰?code>synchronized鍏抽敭瀛楀姞閿佽В閿佹槸涓€姝ュ埌浣嶇殑銆?/p>
鐢变簬鍔犻攣瑙i攣涓や釜鎿嶄綔鏄垎寮€鐨勶紝鐩告瘮浜庡姞閿佽В閿佷竴浣撳寲杩欏氨寰堝鏄撻€犳垚姝婚攣闂锛岃繖鏄洜涓轰竴鏂归潰鍔犻攣鍚庡鏄撳繕璁板幓瑙i攣锛岄€犳垚姝婚攣锛屽彟涓€鏂归潰鍔犻攣鍚庤В閿佸墠涓棿鐨勪唬鐮佷竾涓€鍑轰簡闂锛屽彲鑳戒細瀵艰嚧瑙i攣鏃犳硶姝e父鎵ц瀵艰嚧瑙i攣澶辫触锛岄€犳垚姝婚攣銆?br>
鎵€浠ヤ娇鐢?code>ReentrantLock绫绘椂锛屼竴鑸鎼厤finally
浣跨敤銆?/p>
ReentrantLock lock = new ReentrantLock();
//dosomething
lock.lock();
try {
// working
} finally {
lock.unlock()
}
馃尭ReentrantLock
绫讳笌synchronized
鍏抽敭瀛楀尯鍒細
-
ReentrantLock
鏄竴涓猨ava鏍囧噯绫伙紝鏄娇鐢╦ava浠g爜瀹炵幇鐨勶紝synchronized
鏄竴涓叧閿瓧锛屾槸鍩轰簬JVM鍐呴儴瀹炵幇鐨勶紝鏄疌/C++浠g爜銆?/li> -
ReentrantLock
闇€瑕佹墜鍔ㄨВ閿侊紝闇€璋ㄩ槻蹇樿瑙i攣锛岃€?code>synchronized鍔犻攣瑙i攣涓€浣撳寲锛屼笉闇€瑕佹墜鍔ㄨВ閿併€?/li> - 濡傛灉鍑虹幇閿佺珵浜夛紝
ReentrantLock
绔炰簤澶辫触鏃跺彲浠ラ樆濉炵瓑寰咃紝涔熷彲浠ラ€氳繃trylock鏂规硶鐩存帴杩斿洖閫€鍑猴紝鑰?code>synchronized绔炰簤澶辫触鏃跺彧鑳介樆濉炵瓑寰呫€?/li> -
ReentrantLock
鏋勯€犲疄渚嬪璞℃椂锛屽彲浠ユ寚瀹歠air鍙傛暟鏉ュ喅瀹氳閿佸璞℃槸鍏钩閿佽繕闈炲叕骞抽攣锛?code>synchronized鍔犵殑閿佹槸闈炲叕骞抽攣锛屼笉鑳芥寚瀹氫负鍏钩閿併€?/li> -
ReentrantLock
绫昏鐢熷嚭鐨勭瓑寰呮満鍒舵槸Condition
绫伙紝synchronized
鍏抽敭瀛楄鐢熺殑绛夊緟鏈哄埗鏄?code>wait/notify绛夊緟鏈哄埗銆?/li>
馃崅2.3Semaphore绫伙紙淇″彿閲忥級
杩欎釜姒傚康姣旇緝鎶借薄锛屾垜浠潵鎵撲釜姣旀柟锛屾湁涓仠杞﹀満锛屽仠杞﹀満闂ㄥ彛鏈変竴涓伅鐗岋紝浼氭樉绀哄仠杞︿綅杩樺墿浣欏灏戜釜锛屾瘡杩涘幓涓€杈嗚溅锛屾樉绀虹殑鍋滆溅浣嶆暟閲忓氨鍑忎竴锛屾瘡鍑哄幓涓€杈嗗嚭锛屾樉绀虹殑鍋滆溅浣嶆暟閲忓氨鍔犱竴銆?/p>
涓婇潰鏄剧ず鍋滆溅浣嶆暟閲忕殑鐏墝鍏跺疄灏辨槸淇″彿閲忥紝淇″彿閲忔槸涓€鏇村姞骞夸箟鐨勯攣锛屾弿杩颁簡鍙敤璧勬簮鐨勪釜鏁般€?br> 姣忔鐢宠涓€涓彲鐢ㄨ祫婧愶紝淇″彿閲忎腑鐨勮鏁板櫒灏卞噺涓€锛圥鎿嶄綔锛夈€?br> 姣忔閲婃斁涓€涓彲鐢ㄨ祫婧愶紝淇″彿閲忎腑鐨勮鏁板櫒灏卞姞涓€锛圴鎿嶄綔锛夈€?br> 褰撳彲鐢ㄨ祫婧愭暟閲忎负0鏃讹紝鍐嶆杩涜P鎿嶄綔锛屼細闄峰叆闃诲绛夊緟鐘舵€併€?/p>
閿佹垜浠彲浠ョ悊瑙d负鈥滀簩鍏冧俊鍙烽噺鈥濓紝鍥犱负璁℃暟鍣ㄧ殑鍙栧€间笉鏄?灏辨槸1锛屽畠鐨勫彲鐢ㄨ祫婧愬氨涓€涓€?/p>
馃尭Semaphore绫荤殑甯哥敤鏂规硶锛?/p>
搴忓彿 | 鏂规硶 | 鏂规硶绫诲瀷 | 浣滅敤 |
---|---|---|---|
1 | public Semaphore(int permits) | 鏋勯€犳柟娉?/td> | 鏋勯€犲彲鐢ㄨ祫婧愪负permits涓殑淇″彿閲忓璞?/td> |
2 | public Semaphore(int permits, boolean fair) | 鏋勯€犳柟娉?/td> | 鐩告瘮浜庢柟娉?锛岃鏋勯€犳柟娉曡繕鑳芥寚瀹氫俊鍙烽噺鏄惁鏄叕骞虫€ц川鐨?/td> |
3 | public void acquire() throws InterruptedException | 鏅€氭柟娉?/td> | 鐢宠鍙敤璧勬簮 |
4 | public void release() | 鏅€氭柟娉?/td> | 閲婃斁鍙敤璧勬簮 |
馃尭浠g爜婕旂ず锛?/p>
import java.util.concurrent.Semaphore;
public class Main {
public static void main(String[] args) throws InterruptedException {
//鏋勯€犳柟娉曚腑鐨刾ermits鍙傛暟琛ㄧず鍙敤璧勬簮鐨勪釜鏁?
Semaphore semaphore = new Semaphore(4);
//姣忔浣跨敤涓€涓彲鐢ㄨ祫婧愶紝淇″彿閲忓氨浼氬噺灏?
semaphore.acquire();
System.out.println("鐢宠鎴愬姛");
semaphore.acquire();
System.out.println("鐢宠鎴愬姛");
semaphore.acquire();
System.out.println("鐢宠鎴愬姛");
semaphore.acquire();
System.out.println("鐢宠鎴愬姛");
//姝ゆ椂鍙敤璧勬簮涓?锛岀嚎绋嬭繘鍏ラ樆濉烇紝闇€瑕佷娇鐢╮elease鏂规硶閲婃斁璧勬簮锛岀嚎绋嬫墠鑳界户缁墽琛?
semaphore.release();
System.out.println("閲婃斁鎴愬姛");
semaphore.acquire();
System.out.println("鐢宠鎴愬姛");
}
}
澶嶅埗浠g爜
馃尭鎵ц缁撴灉锛?/p>
鐢宠鎴愬姛
鐢宠鎴愬姛
鐢宠鎴愬姛
鐢宠鎴愬姛
閲婃斁鎴愬姛
鐢宠鎴愬姛
Process finished with exit code 0
馃崅2.4CountDownLatch鍚屾宸ュ叿绫?/h2>
CountDownLatch鏄竴涓悓姝ュ伐鍏风被锛屽畠鍏佽涓€涓垨澶氫釜绾跨▼涓€鐩寸瓑寰咃紝鐩村埌鍏朵粬绾跨▼鎵ц瀹屽悗鍐嶆墽琛屻€?br> 鎵撲釜姣旀柟锛屽亣璁炬湁涓€鍦鸿窇姝ユ瘮璧涳紝涓€涓湁5涓繙鍔ㄥ憳鍙傝禌锛屽彧鏈夊綋鏈€鍚庝竴涓繙鍔ㄥ憳鍐茶繃缁堢偣绾挎椂锛岃鍒ゆ墠鑳藉甯冩瘮璧涚粨鏉熴€?/p>
杩欓噷鐨勮繍鍔ㄥ憳灏辩浉褰撲簬绾跨▼锛岃鍒ゅ氨鐩稿綋浜?code>CountDownLatch绫汇€?/p>
馃尭CountDownLatch鍚屾宸ュ叿绫诲父鐢ㄦ柟娉曪細
搴忓彿 | 鏂规硶 | 鏂规硶绫诲瀷 | 浣滅敤 |
---|---|---|---|
1 | public CountDownLatch(int count) | 鏋勯€犳柟娉?/td> | 鏋勯€犲疄渚嬪璞★紝count琛ㄧずCountDownLatch瀵硅薄涓鏁板櫒鐨勫€?/td> |
2 | public void await() throws InterruptedException | 鏅€氭柟娉?/td> | 浣挎墍澶勭殑绾跨▼杩涘叆闃诲绛夊緟锛岀洿鍒拌鏁板櫒鐨勫€兼竻闆?/td> |
3 | public void countDown() | 鏅€氭柟娉?/td> | 灏嗚鏁板櫒鐨勫€煎噺1 |
4 | public long getCount() | 鏅€氭柟娉?/td> | 鑾峰彇璁℃暟鍣ㄦ渶鍒濈殑鍊?/td> |
馃尭浣跨敤鏂瑰紡锛?/strong>
- 鍒涘缓
CountDownLatch
瀵硅薄锛屽苟鍒濆鍖栬鏁板櫒鐨勫€笺€?/li> - 鍦ㄦ瘡涓嚎绋嬫墽琛岀殑鏈€鍚庝娇鐢?code>countDown鏂规硶锛岃〃绀哄綋鍓嶇嚎绋嬫墽琛屽畬姣曪紝璁℃暟鍣ㄧ殑鍊煎噺1銆?/li>
- 鍦ㄤ富绾跨▼涓娇鐢?code>await鏂规硶锛岀瓑寰?code>CountDownLatch瀵硅薄鐨勮鏁板櫒娓呴浂锛岃〃绀烘墍绠$悊鐨勭嚎绋嬪叏閮ㄦ墽琛屽畬姣曪紝璧峰埌绾跨▼鍚屾鐨勪綔鐢ㄣ€?/li>
馃尭鍙傝€冧唬鐮侊細
import java.util.concurrent.*;
public class Main {
public static final int COUNT = 5;
public static void main(String[] args) throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(COUNT);
for (int i = 0; i < COUNT; i++) {
Thread thread = new Thread(() -> {
try {
Thread.sleep(1000);
System.out.println(Thread.currentThread().getName() + "浠诲姟鎵ц瀹屾瘯锛?);
countDownLatch.countDown();
} catch (InterruptedException e) {
e.printStackTrace();
}
});
thread.start();
}
//绛夊緟璁℃暟鍣ㄦ竻闆讹紝娓呴浂鍓嶏紝绾跨▼澶勪簬闃诲绛夊緟鐘舵€侊紝娓呴浂鍚庯紝鍗冲叏閮ㄤ换鍔℃墽琛屽畬姣?
countDownLatch.await();
System.out.println("浠诲姟鍏ㄩ儴瀹屾垚锛?);
}
}
杩欐牱鐨勫満鏅湪瀹為檯寮€鍙戝綋涓紝涔熸槸寰堝父瑙佺殑锛屾瘮濡傝涓嬭浇涓€涓緝澶х殑鏂囦欢鐨勬椂鍊欙紝甯稿父灏嗘枃浠舵媶鍒嗭紝浣跨敤澶氱嚎绋嬪苟鍙戜笅杞姐€?/p>
鑰屽湪杩欐牱涓€涓満鏅腑锛岄渶瑕佺瓑寰呮渶鍚庝竴涓嚎绋嬩篃涓嬭浇瀹屾瘯锛屾墠鑳借鏁翠釜鏂囦欢涓嬭浇瀹屾瘯锛屼篃灏辨槸浣跨敤CountDownLatch瀵硅薄杩涜璁℃暟锛岀瓑璁℃暟鍣ㄦ竻闆朵簡await
鏂规硶灏变細杩斿洖锛岃〃绀烘枃浠朵笅杞藉畬鎴愩€?/p>
馃崅2.5鏈夊叧鏁版嵁缁撴瀯鐨勭嚎绋嬪畨鍏ㄧ被
馃崄2.5.1澶氱嚎绋嬩娇鐢ㄩ『搴忚〃
ArrayList鍦ㄥ绾跨▼涓槸绾跨▼涓嶅畨鍏ㄧ殑锛屽绾跨▼鐜涓娇鐢ㄥ熀浜庡啓瀹炴嫹璐濆疄鐜扮殑CopyOnWriteArrayList銆?/p>
鎵€璋撳啓瀹炴嫹璐濓紝灏辨槸鍐欑殑鏃跺€欎細鍒涘缓涓€涓壇鏈紝鍐嶅壇鏈笂杩涜淇敼锛屽悓鏃跺鏋滃瓨鍦ㄨ鎿嶄綔浼氬湪鍘熸枃浠舵暟杩涜鏌ヨ锛岀瓑淇敼瀹屾瘯鍚庡氨浼氬皢鍓湰鈥滆浆姝b€濄€?/p>
馃崄2.5.2澶氱嚎绋嬩娇鐢ㄩ槦鍒?/h3>
馃尭澶氱嚎绋嬫儏鍐典笅甯稿父浣跨敤闃诲闃熷垪锛?/p>
- ArrayBlockingQueue 鍩轰簬鏁扮粍瀹炵幇鐨勯樆濉為槦鍒?/li>
- LinkedBlockingQueue 鍩轰簬閾捐〃瀹炵幇鐨勯樆濉為槦鍒?/li>
- PriorityBlockingQueue 鍩轰簬鍫嗗疄鐜扮殑甯︿紭鍏堢骇鐨勯樆濉為槦鍒?/li>
- TransferQueue 鏈€澶氬彧鍖呭惈涓€涓厓绱犵殑闃诲闃熷垪
馃崄2.5.3澶氱嚎绋嬩娇鐢ㄥ搱甯岃〃
HashMap鏈韩鏄嚎绋嬩笉瀹夊叏鐨勶紝灏咹ashMap涓殑閲嶈鏂规硶浣跨敤synchornized
鍔犻攣鍚庯紝灏卞緱鍒颁簡HashTable绫伙紝铏界劧HashTable绫绘槸绾跨▼瀹夊叏鐨勶紝浣嗘槸鐢变簬鏄鏂规硶杩涜鏃犺剳鍔犻攣锛屾湰璐ㄥ姞閿佺殑瀵硅薄鏄疕ashTable绫荤殑瀹炰緥瀵硅薄锛岃繖鏍峰氨浼氬鑷撮攣绔炰簤姒傜巼鍔犲ぇ锛屽氨鐩稿綋浜庡叕鍙搁噷鎵€鏈夌殑鍛樺伐闇€瑕佽鍋囨椂閮介渶瑕佹壘鑰佹澘绛惧瓧鎵瑰噯锛岃繖鏍蜂細瀵艰嚧鑰佹澘闈炲父鍦板繖锛岃繖涓€佹澘灏辩浉褰撲簬鍔犻攣鐨勫搱甯岃〃瀵硅薄锛屾渶缁堜細閫犳垚鍝堝笇琛ㄧ殑鏁堢巼涓嬮檷銆?br>
!](https://upload-images.jianshu.io/upload_images/28168001-faf8ed9196403ae5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
涓轰簡瑙e喅杩欎釜闂锛宩ava鎻愪緵浜咰oncurrentHashMap绫伙紝璇ョ被鏄熀浜庡搱甯岃〃涓殑姣忎竴涓摼琛ㄥ璞¤繘琛屽姞閿侊紝绾跨▼闇€瑕佸鍝釜閾捐〃瀵硅薄杩涜鎿嶄綔锛屽氨鍦ㄥ摢閲屽姞閿侊紝鐢变簬鍝堝笇琛ㄤ腑閾捐〃鏁伴噺寰堝锛岄摼琛ㄥ璞$殑鍏冪礌涓暟杈冨皯锛屽彲浠ユ湁鏁堝湴闄嶄綆閿佺珵浜夌殑姒傜巼锛岀浉褰撲簬鍏徃涓殑鑰佹澘灏嗘潈鍔涗笅鏀剧粰鍚勪釜閮ㄩ棬锛屽憳宸ヨ鍋囨椂鍙渶鍚戞墍鍦ㄧ殑閮ㄩ棬棰嗗璇峰亣鍗冲彲銆?/p>
鍒拌繖閲岋紝Java澶氱嚎绋嬫湁鍏冲唴瀹瑰熀鏈笂閮戒粙缁嶅畬姣?/p>