锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产免费综合,亚洲成AV人片天堂网无码,亚洲欧洲国产精品香蕉网http://www.tkk7.com/seosyw/archive/2015/01/01/422007.html钁h秴媧?/dc:creator>钁h秴媧?/author>Thu, 01 Jan 2015 14:34:00 GMThttp://www.tkk7.com/seosyw/archive/2015/01/01/422007.htmlhttp://www.tkk7.com/seosyw/comments/422007.htmlhttp://www.tkk7.com/seosyw/archive/2015/01/01/422007.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/422007.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/422007.html鎴戜滑閮界煡閬擄紝Java錛?a style="color: rgb(11,59,140); font-size: 12px; text-decoration: underline" target="_blank">Java鏁欑▼ Java鍩硅 錛?/strong> ME 浠ュ線縐頒綔J2ME錛?a style="color: rgb(11,59,140); font-size: 12px; text-decoration: underline" target="_blank">J2ME鍩硅 錛?/strong>(Java Platform錛孧icro Edition)錛屾槸涓烘満欏剁洅銆佺Щ鍔ㄧ數(shù)璇濆拰PDA涔嬬被宓屽叆寮忔秷璐圭數(shù)瀛愯澶囨彁渚涚殑Java璇█騫沖彴錛屽寘鎷櫄鎷熸満鍜屼竴緋誨垪鏍囧噯鍖栫殑Java API銆傚畠鍜孞ava SE銆丣ava EE涓璧鋒瀯鎴怞ava鎶鏈殑涓夊ぇ鐗堟湰錛屽茍涓斿悓鏍鋒槸閫氳繃JCP(Java Community Process)鍒惰鐨勩?/p>

銆銆J2ME騫沖彴涓湁鍑犱釜閲嶈鐨勬蹇碉紝渚嬪鍐呭瓨銆丆LDC銆丮IDP絳夈傚垵瀛2ME寰寰瀵硅繖浜涙蹇電悊瑙d笉娣憋紝鐢氳嚦鍑虹幇鍋忓樊銆傛湰鏂囩殑鐩殑鍦ㄤ簬瀵笿2ME涓殑鐩稿叧閲嶈姒傚康榪涜闃愯堪銆?/p>

銆銆1. 鍐呭瓨

銆銆鎴戜滑涓鐩村湪寮鴻皟錛岀Щ鍔ㄤ俊鎭澶囩殑鍐呭瓨闈炲父灝忥紝浣跨敤璧鋒潵搴旇鍔犲嶇殑鐝嶆儨錛屼絾鏄垜浠嵈寰堝皯鐭ラ亾榪欎簺鍐呭瓨鏄浣曞垎綾葷殑錛屼笅闈㈠皢鍋氳緇嗙殑浠嬬粛銆備簨瀹炰笂MIDP璁懼鐨勫唴瀛樺垎涓轟笁縐嶏紝Programme Memory銆丠eap銆乸ersistent Storage銆?/p>

銆銆Programme Memory鏄Щ鍔ㄤ俊鎭澶囧垎閰嶇粰MIDlet suite鐨勭┖闂達紝鍥犱負MIDlet suite鏄互jar鏂囦歡榪涜鍙戝竷鐨勶紝鎵浠ヨ繖涓枃浠剁殑澶у皬鍙互璁や負鏄疨rogramme Memory鐨勫ぇ灝忋備竴浜涘巶鍟嗗Programme Memory鐨勬渶澶у兼槸鏈夐檺鍒剁殑錛屼緥濡傛垜鐨凬okia 6108鐨勬渶澶у兼槸 64k錛岃秴榪囩殑璇濆皢涓嶈兘榪涜瀹夎銆傚噺灝廙IDlet suite鐨勫ぇ灝忛潪甯擱噸瑕侊紝涓涓究鎹風殑鏂規(guī)硶灝辨槸浣跨敤娣鋒穯鍣ㄥ搴旂敤紼嬪簭榪涜娣鋒穯錛岃繖鏍峰彲浠ュ噺灝廽ar鏂囦歡鐨勫ぇ灝忋傚湪浠ュ悗鐨勬枃绔犱腑鎴戜細璋堝埌濡備綍浣跨敤 Proguard銆?/p>

銆銆Heap鏄簲鐢ㄧ▼搴忓湪榪愯榪囩▼涓瓨鏀炬墍鍒涘緩鐨勫璞$殑瀛樺偍絀洪棿錛屾湰鍦板彉閲忓拰鎴愬憳鍙橀噺涔熸槸鏀懼湪Heap涓婄殑錛孧IDP璁懼涓彁渚涚殑Heap絀洪棿澶ф鍦ㄥ嚑鍗乲鍒板嚑鐧綤銆?/p>

銆銆Persistent Storage鐨勭┖闂存槸鐢ㄦ潵瀹炵幇MIDP搴旂敤紼嬪簭鐨勬湰鍦版暟鎹寔涔呮у瓨鍌ㄧ殑錛屽湪Record Management System浠庡叆闂ㄥ埌綺鵑氫腑鎴戝仛浜嗚緇嗙殑浠嬬粛榪欓噷灝變笉鍐嶅璇翠簡銆?/p>

銆銆2. Connected Limited Device Configuration

銆銆CLDC鍖呮嫭涓涓?strong>Java铏氭嫙鏈哄拰涓緋誨垪鐨勫熀紜綾伙紝J2ME鐨勪笓瀹剁粍緇忚繃瀵圭Щ鍔ㄤ俊鎭澶囪繘琛岀‖浠舵娊璞″悗寰楀埌浠栦滑鐨勭壒鐐癸紝鐒跺悗璁捐騫跺疄鐜頒簡鍦ㄧЩ鍔ㄤ俊鎭澶囦笂榪愯鐨刯ava铏氭嫙鏈猴紝閫氬父鎴戜滑鎶婂畠鍙仛KVM銆傚湪CLDC1.0榪樺悓鏃舵彁渚涗簡鐢眏ava.io銆乯ava.lang銆?javax.microediton.io銆乯ava.util緇勬垚鐨勫熀紜綾匯傚湪CLDC1.1閲岄潰娣誨姞浜唈ava.lang.ref銆?/p>

銆銆3. Mobile Infomation Device Profile

銆銆MIDP鏄繍琛屽湪CLDC鍩虹涔嬩笂鐨勶紝鍦∕IDP涓畾涔変簡搴旂敤紼嬪簭鐨勭敓鍛藉懆鏈熴佺敤鎴峰浘褰㈢晫闈€佹暟鎹鐞嗙郴緇熺瓑瀛愰泦錛屼粠鑰屾瀯寤鴻搗浜咼2ME騫沖彴銆傞氬父錛?strong>J2ME騫沖彴鐢變竴涓狢LDC鍜屼竴涓垨鑰呭涓狿rofile鏋勬垚銆?/p>

銆銆甯屾湜閫氳繃浠ヤ笂鍐呭鐨勪粙緇嶏紝璁╀綘鑳芥洿濂界殑搴旂敤J2ME騫沖彴銆?/p>

]]>
Java鍐呭瓨娉勬紡璋冭瘯http://www.tkk7.com/seosyw/archive/2014/11/21/420381.html钁h秴媧?/dc:creator>钁h秴媧?/author>Fri, 21 Nov 2014 01:06:00 GMThttp://www.tkk7.com/seosyw/archive/2014/11/21/420381.htmlhttp://www.tkk7.com/seosyw/comments/420381.htmlhttp://www.tkk7.com/seosyw/archive/2014/11/21/420381.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/420381.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/420381.htmlJDK鏈韓涓鴻皟璇曞唴瀛樻硠婕忛棶棰樻彁渚涗簡姣旇緝瀹屽杽鐨勫伐鍏楓?/p>

銆銆鍏堢敤鍛戒護jps鎵懼嚭瑕佽皟璇曠殑jvm鐨勮繘紼媔d(jps榪欎釜鍛戒護錛屽氨鏄痯s鍛戒護鍓嶉潰鍔爅錛屽垪鍑烘墍鏈夋鍦ㄨ繍琛岀殑jvm鐨勮繘紼媔d)銆?/p>

銆銆渚嬪錛歫ps

銆銆杈撳嚭綾諱技涓嬮潰榪欐牱錛?5976 java_app.jar 7586 startup.jar 22476 Jps 12248 Main 5437 Bootstrap

銆銆鍋囪鎴戜滑瑕佽皟璇曠殑榪涚▼id鏄?5976.

銆銆濡傛灉鍙槸鎯崇畝鍗曡瀵熶竴涓嬪爢鍐呭瓨鐨勪嬌鐢ㄦ儏鍐碉紝鍙互鐢ㄥ懡浠map -histo錛歭ive 15976榪欎釜鍛戒護浼氳緭鍑烘寚瀹氱殑jvm涓婂綋鍓嶅悇涓?strong>Java綾葷殑瀹炰緥鏁般佸崰鐢ㄧ殑鍐呭瓨澶у皬鍜屽畬鏁寸殑綾誨悕銆傝櫄鎷熸満鍐呴儴綾葷殑綾誨悕鍓嶉潰鏈?*"鏍囪銆?/p>

銆銆濡傛灉鎯沖緱鍒板爢鍐呭瓨浣跨敤鐨勮緇嗘儏鍐碉紝鍙互鐢ㄥ懡浠map -dump錛歭ive錛宖ormat=b錛宖ile=/tmp/java_app-heap.bin 15976

銆銆榪欐牱鍦?tmp鐩綍涓嬪緱鍒頒竴涓猨ava_app-heap.bin鏂囦歡錛屽叾涓繚瀛樼殑淇℃伅灝辨槸鎸囧畾鐨刯vm涓爢鍐呭瓨鐨勪嬌鐢ㄨ鎯呫傝繖涓簩榪涘埗鏂囦歡鍙互鐢↗DK闄勫甫鐨刯hat(Java Heap Analysis Tool)鏉ュ垎鏋愶細

銆銆jhat -J-Xmx326m /tmp/java_app-heap.bin

銆銆榪欎釜宸ュ叿鐩稿綋鑰楀唴瀛橈紝濡傛灉鍑虹幇浜哋utOfMemoryException鐨勮瘽錛岃鍔犲ぇ-J-Xmx326m涓寚瀹氱殑棰勭暀鍫嗗唴瀛樺ぇ灝忓啀璇曘?/p>

銆銆Jhat浼氳В鏋愬爢鍐呭瓨淇℃伅杞偍鏂囦歡(涓婇潰鐢╦map鐢熸垚鐨勩俠in鏂囦歡)錛岃緭鍑哄ぇ姒傚儚涓嬮潰榪欐牱錛?/p>

銆銆lewis@mgr $ jhat -J-Xmx326m /tmp/java_app-heap.bin Reading from /tmp/java_app-heap.bin……

銆銆Dump file created Thu Sep 08 20錛?8錛?4 CST 2011 Snapshot read錛?resolving……

銆銆Resolving 71327 objects……

銆銆Chasing references錛?expect 14 dots……

銆銆Eliminating duplicate references……

銆銆Snapshot resolved. Started HTTP server on port 7000 Server is ready.

銆銆娉ㄦ剰鏈鍚庝袱琛岋細鍫嗗唴瀛樹俊鎭漿鍌ㄦ枃浠跺垎鏋愬畬姣曞悗錛宩hat騫朵笉浼氬皢鍒嗘瀽緇撴灉杈撳嚭涓轟竴涓潤鎬佹枃浠躲?/p>

銆銆涓轟簡鏂逛究鏌ユ壘錛屼互鍙婂湪鐩稿叧鐨勭被涔嬮棿瀵艱埅錛宩hat浼氬惎鍔ㄤ竴涓湇鍔★紝鐩戝惉7000绔彛銆傝繖鏃跺欏氨鍙互鐢ㄦ祻瑙堝櫒鏉ユ祻瑙堝拰鍒嗘瀽緇撴灉浜嗭細鍦ㄦ祻瑙堝櫒鍦板潃鏍忛噷杈撳叆錛?/p>

銆銆http://localhost錛?000

銆銆閲岄潰鐨勫悇涓〉闈㈤兘鏈夊緢澶氶摼鎺ワ紝鍙互鍦ㄧ浉鍏崇殑鍚勪釜綾誨強鍚勭緇熻鏁版嵁涔嬮棿璺寵漿錛岃繕鏄緢鏂逛究鐨勩?/p>

]]>
嫻呰堪Java鏋氫婦甯歌7縐嶇敤娉?/title><link>http://www.tkk7.com/seosyw/archive/2014/11/21/420379.html</link><dc:creator>钁h秴媧?/dc:creator><author>钁h秴媧?/author><pubDate>Fri, 21 Nov 2014 01:03:00 GMT</pubDate><guid>http://www.tkk7.com/seosyw/archive/2014/11/21/420379.html</guid><wfw:comment>http://www.tkk7.com/seosyw/comments/420379.html</wfw:comment><comments>http://www.tkk7.com/seosyw/archive/2014/11/21/420379.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/seosyw/comments/commentRss/420379.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/seosyw/services/trackbacks/420379.html</trackback:ping><description><![CDATA[     鎽樿: DK1.5寮曞叆浜嗘柊鐨勭被鍨?#8212;—鏋氫婦銆傚湪 Java 涓畠铏界劧綆椾釜“灝?#8221;鍔熻兘錛屽嵈緇欐垜鐨勫紑鍙戝甫鏉ヤ簡“澶?#8221;鏂逛究銆?銆銆鐢ㄦ硶涓錛氬父閲?銆銆鍦↗DK1.5 涔嬪墠錛屾垜浠畾涔夊父閲忛兘鏄細 publicstaticfianl.... 銆傜幇鍦ㄥソ浜嗭紝鏈変簡鏋氫婦錛屽彲浠ユ妸鐩稿叧鐨勫父閲忓垎緇勫埌涓涓灇涓劇被鍨嬮噷錛岃屼笖鏋氫婦鎻愪緵浜嗘瘮甯擱噺鏇村鐨勬柟娉曘?..  <a href='http://www.tkk7.com/seosyw/archive/2014/11/21/420379.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/seosyw/aggbug/420379.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/seosyw/" target="_blank">钁h秴媧?/a> 2014-11-21 09:03 <a href="http://www.tkk7.com/seosyw/archive/2014/11/21/420379.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>JAR鏂囦歡鎿嶄綔鍩虹http://www.tkk7.com/seosyw/archive/2014/11/21/420377.html钁h秴媧?/dc:creator>钁h秴媧?/author>Fri, 21 Nov 2014 01:01:00 GMThttp://www.tkk7.com/seosyw/archive/2014/11/21/420377.htmlhttp://www.tkk7.com/seosyw/comments/420377.htmlhttp://www.tkk7.com/seosyw/archive/2014/11/21/420377.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/420377.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/420377.htmlThe Java錛?a style="color: rgb(11,59,140); font-size: 12px; text-decoration: underline" target="_blank">Java鏁欑▼ Java鍩硅 錛?/strong> Archive (JAR) File Format JAR鏂囦歡鏄敤ZIP鏂囦歡鏍煎紡鎵撳寘鐨勶紝鎵浠ヤ綘鍙互鍦ㄤ竴浜涚被浼糧IP鐨勪換鍔′腑浣跨敤瀹冿紝榪涜鍘嬬緝銆佽В鍘嬨佹墦鍖呮垨鑰呰В寮鍖呫傝繖浜涢兘鏄疛AR鏂囦歡鏈鏅亶鐨勪嬌鐢ㄦ柟寮忥紝浣犺兘鍙戠幇璁稿JAR鏂囦歡鐨勪紭鍔塊兘鏄簮鑷繖浜涘熀鏈殑鐗圭偣銆?/p>

銆銆鍗充嬌浣犲笇鏈涜兘澶熶嬌鐢↗AR涓偅浜涘厛榪涚殑鍔熻兘姣斿鐢?shù)瀛惤{懼悕錛屼綘涔熷緱鍏堢啛鎮(zhèn)変竴浜涘熀鏈殑鎿嶄綔鏂瑰紡銆?/p>

銆銆浣犲彲浠ヤ嬌鐢?strong>Java Archive Tool 鏉ュ畬鎴怞AR鏂囦歡鎿嶄綔銆傝繖涓伐鍏瘋鍖呭惈鍦↗DK涓傚洜涓篔ava Archive Tool 閫氳繃jar鍛戒護鏉ヨ皟鐢紝涓轟簡鏂逛究錛屾垜浠篃鍙互縐板畠涓簀at tool.

銆銆涓嬮潰鏄渶鍩烘湰鐨勫懡浠ゆ搷浣滐細

銆銆鎿嶄綔 鍛戒護鍒涘緩涓涓狫AR鏂囦歡銆?jar cf jar-file input-file(s)

銆銆鏌ョ湅JAR鏂囦歡鐨勫唴瀹?jar tf jar-file瀵煎嚭JAR鏂囦歡 jar xf jar-file瀵煎嚭JAR鏂囦歡涓埗瀹氱殑鏂囦歡鍖?jar xf jar-file archived-file(s)

銆銆榪愯JAR鏂囦歡涓殑搴旂敤jre -cp app.jar MainClass榪愯鐢↗AR鏍煎紡鎵撳寘鐨勫簲鐢╦ava -jar app.jar璋冪敤涓涓墦鍖呮垚JAR鐨刟pplet 涓嬮潰鏄竴浜涜緇嗙殑浠嬬粛錛?/p>

銆銆鍒涘緩JAR鏂囦歡

銆銆jar -cf jar-file input-file(s)

銆銆鍏朵腑c琛ㄧずcreate錛宖琛ㄧずfile錛屽悗闈㈢揣璺焜ar-file.涔熷彲浠ュ鍔犱竴涓獀閫夐」(verbose)錛屼互鏄劇ず璇︾粏淇℃伅 jar -cvf jar-file input-file(s)

銆銆鍏跺疄榪欎簺鍛戒護璺熷父瑙佺殑tar鎵撳寘鍛戒護綾諱技錛屾柟渚胯蹇嗐?/p>

銆銆鍙﹀錛屽湪1.2鐨勭増鏈腑榪樿緗簡涓縐?-C 鐨勯夐」銆傚彲浠ヨ鏌愪簺鏂囦歡澶逛腑鐨勬枃浠剁洿鎺ヨ鎵撳寘鍒版牴鐩綍涓嬶紝鑰屾病鏈夊師濮嬬殑灞傛緇撴瀯鐨勬潫緙氥傚涓嬩緥錛歫ar cf ImageAudio.jar -C images * -C audio *緇撴灉鏄疢ETA-INF/MANIFEST.MF cross.gif nor.gif beep.au ding.au return.au yahoo1.au yahoo2.au

銆銆濡傛灉涓嶇敤 -C閫夐」錛岀洿鎺ユ墦鍖咃細

銆銆jar cf ImageAudio.jar images audio

銆銆緇撴灉濡備笅錛歁ETA-INF/MANIFEST.MF image/cross.gif image/nor.gif audio/beep.au audio/ding.au audio/return.au audio/yahoo1.au audio/yahoo2.au

銆銆鏌ョ湅JAR鏂囦歡涓殑鍐呭You can榪欐椂鍊欏茍娌℃湁瑙e帇jar鏂囦歡錛岀洿鎺ユ煡鐪嬫枃浠跺唴瀹廣?/p>

銆銆jar tvf TicTacToe.jar鍚屾牱鐨勶紝涔熷彲浠ュ鍔?-v 閫夐」(verbose)錛屾樉紺鴻緇嗙殑鏌ョ湅榪囩▼銆?/p>

銆銆瑙e帇JAR鏂囦歡鍖?/p>

銆銆灝唈ar鏂囦歡鍖呬腑鐨勫唴瀹硅В鍘嬪嚭鏉ワ紝鍦ㄥ綋鍓嶅伐浣滅洰褰曚笅(鑰屼笉鏄痡ar鏂囦歡鍖呮墍鍦ㄧ洰褰?鍒涘緩瑙e帇鏂囦歡鍖呫?/p>

銆銆褰撶劧錛屼篃鍙互瀹氬悜鐨勮В鍘嬫寚瀹氱殑鏂囦歡銆傚涓嬶紝鍏朵腑浠呮湁TicTacToe.class images/cross.gif灝嗕細琚В鍘嬪嚭鏉ャ?/p>

銆銆jar xf TicTacToe.jar TicTacToe.class images/cross.gif

銆銆淇敼Manifest鏂囦歡鏈変笉灝戜慨鏀筂anifest鏂囦歡鐨勬柟娉曘傝繖閲屼粙緇嶄竴縐嶇敤jar鎸囦護淇敼鐨勬柟娉曘?/p>

銆銆鏈変竴涓猰閫夐」錛屽彲浠ュ皢鐢ㄦ埛鑷繁緙栬緫鐨刴anifest鏂囦歡鍚屽叾浠栨枃浠跺す涓璧鋒墦鍖呬負JAR鏂囦歡銆?/p>

銆銆jar cmf manifest-addition jar-file input-file(s)

銆銆榪欓噷 manifest-addition 鏄敤鎴瘋嚜宸辯紪杈戝ソ鐨勬枃鏈枃浠訛紝鏂囦歡鍚嶆病鏈夌壒孌婅姹傦紝鍐呭涓洪渶瑕佸啓鍏AR鐨刴anifest鏂囦歡鍐呭銆傚叾浠栫殑璺熷垱寤篔AR鏂囦歡涓鏍楓?/p>

銆銆鏇存柊JAR鏂囦歡

銆銆jar uf jar-file input-file(s)

銆銆褰搃nput-file(s)璺烰AR鏂囦歡涓師鏈夌殑鏂囦歡鍚屽悕鏃訛紝鍒欒鐩栨帀鍘熸潵鐨勬枃浠躲傚鏋滄病鏈夛紝鍒欐坊鍔犵浉搴旀枃浠躲?/p>

銆銆娣誨姞淇敼Manifest鏂囦歡鐨勫懡浠ら夐」鍚庯紝涔熷彲浠ュ疄鐜板manifest鐨勬洿鏂般?/p>

銆銆jar umf manifest jar-file娉ㄦ剰鍏朵腑manifest涓簍xt鏂囦歡錛屽唴瀹規(guī)槸闇瑕佹洿鏂扮殑manifest鏂囦歡鍐呭銆俲ar-file鍒欎負瀵瑰簲鐨凧AR鏂囦歡銆?/p>

銆銆Running JAR-Packaged Software

銆銆java -jar jar-file

銆銆浠ヤ笂鍛戒護鎵ц鐨勬潯浠舵槸 JAR鐨凪anifest鏂囦歡涓叿鏈?Main-Class錛?鏍囪銆傝繖涓爣璁版爣鏄庝簡鏁翠釜JAR涓虹浉搴旂殑涓葷被鏈嶅姟錛岃繖涓富綾諱腑蹇呴』鍚湁static main 紼嬪簭鍏ュ彛銆?/p>

銆銆鐞嗚ВManifest鏂囦歡

銆銆JAR鏂囦歡鑳藉鏀寔璁稿鍔熻兘錛屽寘鎷數(shù)瀛愮鍚嶏紝鐗堟湰鎺у埗錛屽寘鍔犲瘑錛屾墿灞曠瓑絳夈傝繖浜涢兘鏄痬anifest鏂囦歡鐨勫姛鍔?

銆銆manifest鏄竴涓壒孌婄殑鏂囨湰鏂囦歡錛孞AR鏂囦歡鍖呬腑鎵鏈夋枃浠剁殑淇℃伅閮藉彲浠ュ寘鍚湪鍏朵腑銆傞氳繃鍦╩anifest涓緗笉鍚岀殑鍊鹼紝浣犺兘緇橨AR鍖呭娣誨悇縐嶄笉鍚岀殑鐗規(guī)畩鐢ㄩ斻?/p>

銆銆鍦ㄦ垜浠湅鍚勭涓嶅悓鐨勭敤閫斾箣鍓嶏紝鍏堢湅鐪媘anifest鐨勯粯璁ゅ唴瀹癸細鏂囦歡鐨勯粯璁よ礬寰勬槸

銆銆META-INF/MANIFEST.MF榛樿鍐呭鏄?/p>

銆銆Manifest-Version錛?1.0榪欎竴琛屽睍紺轟簡manifest鐨勫熀鏈殑鏍煎紡錛氶敭鍊煎銆傞敭鍜屽肩敤"錛?鍒嗗紑銆傞粯璁anifest涓睍紺轟簡鐗堟湰鍙楓?/p>

銆銆Manifest-Version錛?1.0

銆銆Name錛?java/math/BigDecimal.class

銆銆SHA1-Digest錛?TD1GZt8G11dXY2p4olSZPc5Rj64=

銆銆MD5-Digest錛?z6z8xPj2AW/Q9AKRSF0cg==

銆銆Name錛?span class="Apple-converted-space"> java/math/BigInteger/class

銆銆SHA1-Digest錛歰B1GZt8G11dXY2p4olSZPc5Rj64=

銆銆MD5-Digest錛?z6z8xPj2AW/8HAKRSF0cg==

銆銆榪欓噷灞曠ず浜咼AR鏂囦歡涓紝涓嶅悓銆俢lass鏂囦歡鐨勪笉鍚屽睘鎬с侼ame鏍囪浜嗕笉鍚岀殑瀛愭枃浠訛紝涔嬪悗鐨凷HA1_Digest鍒欐槸瀵瑰簲鏂囦歡鐨勫睘鎬с?/p>

銆銆Main-Class錛?classname Mani-Class閿爣璁頒簡鏁翠釜JAR鏂囦歡榪愯鐨勪富綾匯傚嵆鏁翠釜JAR浣滀負涓涓簲鐢ㄨ繍琛屾椂鐨勭▼搴忓叆鍙c?/p>

銆銆Class-Path錛?servlet.jar infobus.jar acme/beans.jar Class-Path閿爣璁頒簡闇瑕佷笅杞界殑鎵╁睍鍖呫?/p>

]]>
Java綰跨▼瀹夊叏鎬葷粨http://www.tkk7.com/seosyw/archive/2014/11/21/420378.html钁h秴媧?/dc:creator>钁h秴媧?/author>Fri, 21 Nov 2014 01:01:00 GMThttp://www.tkk7.com/seosyw/archive/2014/11/21/420378.htmlhttp://www.tkk7.com/seosyw/comments/420378.htmlhttp://www.tkk7.com/seosyw/archive/2014/11/21/420378.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/420378.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/420378.html

鏈榪戞兂灝?strong>Java錛?a style="color: rgb(11,59,140); font-size: 12px; text-decoration: underline" target="_blank">Java鏁欑▼ Java鍩硅 錛?/strong>鍩虹鐨勪竴浜涗笢瑗塊兘鏁寸悊鏁寸悊錛屽啓涓嬫潵錛岃繖鏄鐭ヨ瘑鐨勬葷粨錛屼篃鏄竴縐嶄箰瓚c傚凡緇忔嫙濂戒簡鎻愮翰錛屽ぇ姒傚垎涓鴻繖鍑犱釜涓婚錛?java綰跨▼瀹夊叏錛宩ava鍨冨溇鏀墮泦錛宩ava騫跺彂鍖呰緇嗕粙緇嶏紝java profile鍜宩vm鎬ц兘璋冧紭銆傛參鎱㈠啓鍚с傛湰浜簀ameswxx鍘熷垱鏂囩珷錛岃漿杞借娉ㄦ槑鍑哄錛屾垜璐逛簡寰堝蹇冭錛屽璋簡銆傚叧浜巎ava綰跨▼瀹夊叏錛岀綉涓婃湁寰堝璧勬枡錛屾垜鍙兂浠庤嚜宸辯殑瑙掑害鎬葷粨瀵硅繖鏂歸潰鐨勮冭檻錛屾湁鏃跺欏啓涓滆タ鏄緢鐥涜嫤鐨勶紝鐭ラ亾涓浜涗笢瑗匡紝浣嗘兂鐢ㄦ枃瀛楄娓呮錛屽嵈涓嶆槸閭d箞瀹規(guī)槗銆傛垜璁や負瑕佽璇唈ava綰跨▼瀹夊叏錛屽繀欏諱簡瑙d袱涓富瑕佺殑鐐癸細java鐨勫唴瀛樻ā鍨嬶紝java鐨勭嚎紼嬪悓姝ユ満鍒躲傜壒鍒槸鍐呭瓨妯″瀷錛宩ava鐨勭嚎紼嬪悓姝ユ満鍒跺緢澶х▼搴︿笂閮芥槸鍩轟簬鍐呭瓨妯″瀷鑰岃瀹氱殑銆傚悗闈㈡垜榪樹細鍐檍ava騫跺彂鍖呯殑鏂囩珷錛岃緇嗘葷粨濡備綍鍒╃敤java騫跺彂鍖呯紪鍐欓珮鏁堝畨鍏ㄧ殑澶氱嚎紼嬪茍鍙戠▼搴忋傛殏鏃跺啓寰楁瘮杈冧粨淇冿紝鍚庨潰浼氭參鎱㈣ˉ鍏呭畬鍠勩?/p>

銆銆嫻呰皥java鍐呭瓨妯″瀷

銆銆涓嶅悓鐨勫鉤鍙幫紝鍐呭瓨妯″瀷鏄笉涓鏍風殑錛屼絾鏄痡vm鐨勫唴瀛樻ā鍨嬭鑼冩槸緇熶竴鐨勩傚叾瀹瀓ava鐨勫綰跨▼騫跺彂闂鏈緇堥兘浼氬弽鏄犲湪java鐨勫唴瀛樻ā鍨嬩笂錛屾墍璋撶嚎紼嬪畨鍏ㄦ棤闈炴槸瑕佹帶鍒跺涓嚎紼嬪鏌愪釜璧勬簮鐨勬湁搴忚闂垨淇敼銆傛葷粨java鐨勫唴瀛樻ā鍨嬶紝瑕佽В鍐充袱涓富瑕佺殑闂錛氬彲瑙佹у拰鏈夊簭鎬с傛垜浠兘鐭ラ亾璁$畻鏈烘湁楂橀熺紦瀛樼殑瀛樺湪錛屽鐞嗗櫒騫朵笉鏄瘡嬈″鐞嗘暟鎹兘鏄彇鍐呭瓨鐨勩侸VM瀹氫箟浜嗚嚜宸辯殑鍐呭瓨妯″瀷錛屽睆钄戒簡搴曞眰騫沖彴鍐呭瓨綆$悊緇嗚妭錛屽浜巎ava寮鍙戜漢鍛橈紝瑕佹竻妤氬湪jvm鍐呭瓨妯″瀷鐨勫熀紜涓婏紝濡傛灉瑙e喅澶氱嚎紼嬬殑鍙鎬у拰鏈夊簭鎬с?/p>

銆銆閭d箞錛屼綍璋撳彲瑙佹?澶氫釜綰跨▼涔嬮棿鏄笉鑳戒簰鐩鎬紶閫掓暟鎹氫俊鐨勶紝瀹冧滑涔嬮棿鐨勬矡閫氬彧鑳介氳繃鍏變韓鍙橀噺鏉ヨ繘琛屻侸ava鍐呭瓨妯″瀷(JMM)瑙勫畾浜唈vm鏈変富鍐呭瓨錛屼富鍐呭瓨鏄涓嚎紼嬪叡浜殑銆傚綋new涓涓璞$殑鏃跺欙紝涔熸槸琚垎閰嶅湪涓誨唴瀛樹腑錛屾瘡涓嚎紼嬮兘鏈夎嚜宸辯殑宸ヤ綔鍐呭瓨錛屽伐浣滃唴瀛樺瓨鍌ㄤ簡涓誨瓨鐨勬煇浜涘璞$殑鍓湰錛屽綋鐒剁嚎紼嬬殑宸ヤ綔鍐呭瓨澶у皬鏄湁闄愬埗鐨勩傚綋綰跨▼鎿嶄綔鏌愪釜瀵硅薄鏃訛紝鎵ц欏哄簭濡備笅錛?/p>

銆銆(1)浠庝富瀛樺鍒跺彉閲忓埌褰撳墠宸ヤ綔鍐呭瓨(read and load)

銆銆(2)鎵ц浠g爜錛屾敼鍙樺叡浜彉閲忓?use and assign)

銆銆(3)鐢ㄥ伐浣滃唴瀛樻暟鎹埛鏂頒富瀛樼浉鍏沖唴瀹?store and write)

銆銆JVM瑙勮寖瀹氫箟浜嗙嚎紼嬪涓誨瓨鐨勬搷浣滄寚浠わ細read錛宭oad錛寀se錛宎ssign錛宻tore錛寃rite.褰撲竴涓叡浜彉閲忓湪澶氫釜綰跨▼鐨勫伐浣滃唴瀛樹腑閮芥湁鍓湰鏃訛紝濡傛灉涓涓嚎紼嬩慨鏀逛簡榪欎釜鍏變韓鍙橀噺錛岄偅涔堝叾浠栫嚎紼嬪簲璇ヨ兘澶熺湅鍒拌繖涓淇敼鍚庣殑鍊鹼紝榪欏氨鏄綰跨▼鐨勫彲瑙佹ч棶棰樸?/p>

銆銆閭d箞錛屼粈涔堟槸鏈夊簭鎬у憿?綰跨▼鍦ㄥ紩鐢ㄥ彉閲忔椂涓嶈兘鐩存帴浠庝富鍐呭瓨涓紩鐢紝濡傛灉綰跨▼宸ヤ綔鍐呭瓨涓病鏈夎鍙橀噺錛屽垯浼氫粠涓誨唴瀛樹腑鎷瘋礉涓涓壇鏈埌宸ヤ綔鍐呭瓨涓紝榪欎釜榪囩▼涓簉ead-load錛屽畬鎴愬悗綰跨▼浼氬紩鐢ㄨ鍓湰銆傚綋鍚屼竴綰跨▼鍐嶅害寮曠敤璇ュ瓧孌墊椂錛屾湁鍙兘閲嶆柊浠庝富瀛樹腑鑾峰彇鍙橀噺鍓湰(read-load-use)錛屼篃鏈夊彲鑳界洿鎺ュ紩鐢ㄥ師鏉ョ殑鍓湰(use)錛屼篃灝辨槸璇?read錛宭oad錛寀se欏哄簭鍙互鐢盝VM瀹炵幇緋葷粺鍐沖畾銆?/p>

銆銆綰跨▼涓嶈兘鐩存帴涓轟富瀛樹腑涓瓧孌佃祴鍊鹼紝瀹冧細灝嗗兼寚瀹氱粰宸ヤ綔鍐呭瓨涓殑鍙橀噺鍓湰(assign)錛屽畬鎴愬悗榪欎釜鍙橀噺鍓湰浼氬悓姝ュ埌涓誨瓨鍌ㄥ尯(store-write)錛岃嚦浜庝綍鏃跺悓姝ヨ繃鍘伙紝鏍規(guī)嵁JVM瀹炵幇緋葷粺鍐沖畾銆傛湁璇ュ瓧孌碉紝鍒欎細浠庝富鍐呭瓨涓皢璇ュ瓧孌佃祴鍊煎埌宸ヤ綔鍐呭瓨涓紝榪欎釜榪囩▼涓簉ead-load錛屽畬鎴愬悗綰跨▼浼氬紩鐢ㄨ鍙橀噺鍓湰錛屽綋鍚屼竴綰跨▼澶氭閲嶅瀵瑰瓧孌佃祴鍊兼椂錛屾瘮濡傦細

銆銆Java浠g爜

銆銆for(int i=0;i<10;i++)

銆銆a++;綰跨▼鏈夊彲鑳藉彧瀵瑰伐浣滃唴瀛樹腑鐨勫壇鏈繘琛岃祴鍊鹼紝鍙埌鏈鍚庝竴嬈¤祴鍊煎悗鎵嶅悓姝ュ埌涓誨瓨鍌ㄥ尯錛屾墍浠ssign錛宻tore錛寃eite欏哄簭鍙互鐢盝VM瀹炵幇緋葷粺鍐沖畾銆傚亣璁炬湁涓涓叡浜彉閲弜錛岀嚎紼媋鎵цx=x+1.浠庝笂闈㈢殑鎻忚堪涓彲浠ョ煡閬搙=x+1騫朵笉鏄竴涓師瀛愭搷浣滐紝瀹冪殑鎵ц榪囩▼濡備笅錛?/p>

銆銆1銆佷粠涓誨瓨涓鍙栧彉閲弜鍓湰鍒板伐浣滃唴瀛?銆佺粰x鍔? 3銆佸皢x鍔?鍚庣殑鍊煎啓鍥炰富 瀛?/p>

銆銆濡傛灉鍙﹀涓涓嚎紼媌鎵цx=x-1錛屾墽琛岃繃紼嬪涓嬶細

銆銆1銆佷粠涓誨瓨涓鍙栧彉閲弜鍓湰鍒板伐浣滃唴瀛?銆佺粰x鍑? 3銆佸皢x鍑?鍚庣殑鍊煎啓鍥炰富瀛?/p>

銆銆閭d箞鏄劇劧錛屾渶緇堢殑x鐨勫兼槸涓嶅彲闈犵殑銆傚亣璁緓鐜板湪涓?0錛岀嚎紼媋鍔?錛岀嚎紼媌鍑?錛屼粠琛ㄩ潰涓婄湅錛屼技涔庢渶緇坸榪樻槸涓?0錛屼絾鏄綰跨▼鎯呭喌涓嬩細鏈夎繖縐嶆儏鍐靛彂鐢燂細

銆銆1錛氱嚎紼媋浠庝富瀛樿鍙杧鍓湰鍒板伐浣滃唴瀛橈紝宸ヤ綔鍐呭瓨涓瓁鍊間負10 2錛氱嚎紼媌浠庝富瀛樿鍙杧鍓湰鍒板伐浣滃唴瀛橈紝宸ヤ綔鍐呭瓨涓瓁鍊間負10 3錛氱嚎紼媋灝嗗伐浣滃唴瀛樹腑x鍔?錛屽伐浣滃唴瀛樹腑x鍊間負11 4錛氱嚎紼媋灝唜鎻愪氦涓誨瓨涓紝涓誨瓨涓瓁涓?1 5錛氱嚎紼媌灝嗗伐浣滃唴瀛樹腑x鍊煎噺1錛屽伐浣滃唴瀛樹腑x鍊間負9 6錛氱嚎紼媌灝唜鎻愪氦鍒頒腑涓誨瓨涓紝涓誨瓨涓瓁涓?

銆銆鍚屾牱錛寈鏈夊彲鑳戒負11錛屽鏋渪鏄竴涓摱琛岃處鎴鳳紝綰跨▼a瀛樻錛岀嚎紼媌鎵f錛屾樉鐒惰繖鏍鋒槸鏈変弗閲嶉棶棰樼殑錛岃瑙e喅榪欎釜闂錛屽繀欏諱繚璇佺嚎紼媋鍜岀嚎紼媌鏄湁搴忔墽琛岀殑錛屽茍涓旀瘡涓嚎紼嬫墽琛岀殑鍔?鎴栧噺1鏄竴涓師瀛愭搷浣溿傜湅鐪嬩笅闈唬鐮侊細

銆銆Java浠g爜

銆銆public class Account {

銆銆private int balance;

銆銆public Account(int balance) { this.balance = balance;}

銆銆public int getBalance() { return balance;}

銆銆public void add(int num) { balance = balance + num;}

銆銆public void withdraw(int num) { balance = balance - num;}

銆銆public static void main(String[] args) throws InterruptedException { Account account = new Account(1000);Thread a = new Thread(new AddThread(account錛?20)錛?"add");Thread b = new Thread(new WithdrawThread(account錛?20)錛?"withdraw");a.start();b.start();a.join();b.join();System.out.println(account.getBalance());}

銆銆static class AddThread implements Runnable { Account account;int amount;

銆銆public AddThread(Account account錛?int amount) { this.account = account;this.amount = amount;}

銆銆public void run() { for (int i = 0; i < 200000; i++) { account.add(amount);}

銆銆static class WithdrawThread implements Runnable { Account account;int amount;

銆銆public WithdrawThread(Account account錛?int amount) { this.account = account;this.amount = amount;}

銆銆public void run() { for (int i = 0; i < 100000; i++) { account.withdraw(amount);}絎竴嬈℃墽琛岀粨鏋滀負10200錛岀浜屾鎵ц緇撴灉涓?060錛屾瘡嬈℃墽琛岀殑緇撴灉閮芥槸涓嶇‘瀹氱殑錛屽洜涓虹嚎紼嬬殑鎵ц欏哄簭鏄笉鍙瑙佺殑銆傝繖鏄痡ava鍚屾浜х敓鐨勬牴婧愶紝synchronized鍏抽敭瀛椾繚璇佷簡澶氫釜綰跨▼瀵逛簬鍚屾鍧楁槸浜掓枼鐨勶紝synchronized浣滀負涓縐嶅悓姝ユ墜孌碉紝瑙e喅java澶氱嚎紼嬬殑鎵ц鏈夊簭鎬у拰鍐呭瓨鍙鎬э紝鑰寁olatile鍏抽敭瀛椾箣瑙e喅澶氱嚎紼嬬殑鍐呭瓨鍙鎬ч棶棰樸傚悗闈㈠皢浼氳緇嗕粙緇嶃?/p>


]]>
java鐨勫唴瀛樼鐞?/title><link>http://www.tkk7.com/seosyw/archive/2014/11/21/420376.html</link><dc:creator>钁h秴媧?/dc:creator><author>钁h秴媧?/author><pubDate>Fri, 21 Nov 2014 01:00:00 GMT</pubDate><guid>http://www.tkk7.com/seosyw/archive/2014/11/21/420376.html</guid><wfw:comment>http://www.tkk7.com/seosyw/comments/420376.html</wfw:comment><comments>http://www.tkk7.com/seosyw/archive/2014/11/21/420376.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/seosyw/comments/commentRss/420376.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/seosyw/services/trackbacks/420376.html</trackback:ping><description><![CDATA[<p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">1銆?strong>Java</strong>鐨勫唴瀛樼鐞嗗氨鏄璞$殑鍒嗛厤鍜岄噴鏀鵑棶棰樸?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍦↗ava涓紝紼嬪簭鍛橀渶瑕侀氳繃鍏抽敭瀛梟ew涓烘瘡涓璞$敵璇峰唴瀛樼┖闂?(鍩烘湰綾誨瀷闄ゅ)錛屾墍鏈夌殑瀵硅薄閮藉湪鍫?(Heap)涓垎閰嶇┖闂淬?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆瀵硅薄鐨勯噴鏀炬槸鐢盙C鍐沖畾鍜屾墽琛岀殑銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍦↗ava涓紝鍐呭瓨鐨勫垎閰嶆槸鐢辯▼搴忓畬鎴愮殑錛岃屽唴瀛樼殑閲婃斁鏄湁GC瀹屾垚鐨勶紝榪欑鏀舵敮涓ゆ潯綰跨殑鏂規(guī)硶綆鍖栦簡紼嬪簭鍛樼殑宸ヤ綔銆備絾涔熷姞閲嶄簡JVM鐨勫伐浣溿傝繖涔熸槸Java紼嬪簭榪愯閫熷害杈冩參鐨勫師鍥犱箣涓銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆GC閲婃斁絀洪棿鏂規(guī)硶錛氱洃鎺ф瘡涓涓璞$殑榪愯鐘舵侊紝鍖呮嫭瀵硅薄鐨勭敵璇楓佸紩鐢ㄣ佽寮曠敤銆佽祴鍊肩瓑銆傚綋璇ュ璞′笉鍐嶈寮曠敤鏃訛紝閲婃斁瀵硅薄銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆2銆佸唴瀛樼鐞嗙粨鏋凧ava浣跨敤鏈夊悜鍥劇殑鏂瑰紡榪涜鍐呭瓨綆$悊錛屽浜庣▼搴忕殑姣忎竴涓椂鍒伙紝鎴戜滑閮芥湁涓涓湁鍚戝浘琛ㄧずJVM鐨勫唴瀛樺垎閰嶆儏鍐點?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆灝嗗璞¤冭檻涓烘湁鍚戝浘鐨勯《鐐癸紝灝嗗紩鐢ㄥ叧緋昏冭檻涓哄浘鐨勬湁鍚戣竟錛屾湁鍚戣竟浠庡紩鐢ㄨ呮寚鍚戣寮曞璞°傚彟澶栵紝姣忎釜綰跨▼瀵硅薄鍙互浣滀負涓涓浘鐨勮搗濮嬮《鐐癸紝渚嬪澶у紼嬪簭浠巑ain榪涚▼寮濮嬫墽琛岋紝閭d箞璇ュ浘灝辨槸浠ain榪涚▼欏剁偣寮濮嬬殑涓媯墊牴鏍戙傚湪榪欎釜鏈夊悜鍥句腑錛屾牴欏剁偣鍙揪鐨勫璞¢兘鏄湁鏁堝璞★紝GC灝嗕笉鍥炴敹榪欎簺瀵硅薄銆傚鏋滄煇涓璞?(榪為氬瓙鍥?涓庤繖涓牴欏剁偣涓嶅彲杈?娉ㄦ剰錛岃鍥句負鏈夊悜鍥?錛岄偅涔堟垜浠涓鴻繖涓?榪欎簺)瀵硅薄涓嶅啀琚紩鐢紝鍙互琚獹C鍥炴敹銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆3銆佷嬌鐢ㄦ湁鍚戝浘鏂瑰紡綆$悊鍐呭瓨鐨勪紭緙虹偣Java浣跨敤鏈夊悜鍥劇殑鏂瑰紡榪涜鍐呭瓨綆$悊錛屽彲浠ユ秷闄ゅ紩鐢ㄥ驚鐜殑闂錛屼緥濡傛湁涓変釜瀵硅薄錛岀浉浜掑紩鐢紝鍙瀹冧滑鍜屾牴榪涚▼涓嶅彲杈劇殑錛岄偅涔圙C涔熸槸鍙互鍥炴敹瀹冧滑鐨勩?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆榪欑鏂瑰紡鐨勪紭鐐規(guī)槸綆$悊鍐呭瓨鐨勭簿搴﹀緢楂橈紝浣嗘槸鏁堢巼杈冧綆銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍙﹀涓縐嶅父鐢ㄧ殑鍐呭瓨綆$悊鎶鏈槸浣跨敤璁℃暟鍣紝渚嬪COM妯″瀷閲囩敤璁℃暟鍣ㄦ柟寮忕鐞嗘瀯浠訛紝瀹冧笌鏈夊悜鍥劇浉姣旓紝綺懼害琛屼綆(寰堥毦澶勭悊寰幆寮曠敤鐨勯棶棰?錛屼絾鎵ц鏁堢巼寰堥珮銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆★<span id="x3hhrjt" class="Apple-converted-space"> </span><strong>Java</strong>鐨勫唴瀛樻硠闇睯ava铏界劧鐢盙C鏉ュ洖鏀跺唴瀛橈紝浣嗕篃鏄瓨鍦ㄦ硠闇查棶棰樼殑錛屽彧鏄瘮C++灝忎竴鐐廣?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆1銆佷笌C++鐨勬瘮杈僣++鎵鏈夊璞$殑鍒嗛厤鍜屽洖鏀墮兘闇瑕佺敱鐢ㄦ埛鏉ョ鐞嗐傚嵆闇瑕佺鐞嗙偣錛屼篃闇瑕佺鐞嗚竟銆傝嫢瀛樺湪涓嶅彲杈劇殑鐐癸紝鏃犳硶鍦ㄥ洖鏀跺垎閰嶇粰閭d釜鐐圭殑鍐呭瓨錛屽鑷村唴瀛樻硠闇層傚瓨鍦ㄦ棤鐢ㄧ殑瀵硅薄寮曠敤錛岃嚜鐒朵篃浼氬鑷村唴瀛樻硠闇層?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆Java鐢盙C鏉ョ鐞嗗唴瀛樺洖鏀訛紝GC灝嗗洖鏀朵笉鍙揪鐨勫璞″崰鐢ㄧ殑鍐呭瓨絀洪棿銆傛墍浠ワ紝Java闇瑕佽冭檻鐨勫唴瀛樻硠闇查棶棰樹富瑕佹槸閭d簺琚紩鐢ㄤ絾鏃犵敤鐨勫璞?#8212;—鍗蟲寚瑕佺鐞嗚竟灝卞彲浠ャ傝寮曠敤浣嗘棤鐢ㄧ殑瀵硅薄錛岀▼搴忓紩鐢ㄤ簡璇ュ璞★紝浣嗗悗緇笉浼氬啀浣跨敤瀹冦傚畠鍗犵敤鐨勫唴瀛樼┖闂村氨嫻垂浜嗐?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆濡傛灉瀛樺湪瀵硅薄鐨勫紩鐢紝榪欎釜瀵硅薄灝辮瀹氫箟涓?#8220;媧誨姩鐨?#8221;錛屽悓鏃朵笉浼氳閲婃斁銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆2銆丣ava鍐呭瓨娉勯湶澶勭悊澶勭悊Java鐨勫唴瀛樻硠闇查棶棰橈細紜璇ュ璞′笉鍐嶄細琚嬌鐢ㄣ?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍏稿瀷鐨勫仛娉?#8212;—鎶婂璞℃暟鎹垚鍛樿涓簄ull浠庨泦鍚堜腑縐婚櫎璇ュ璞℃敞鎰忥紝褰撳眬閮ㄥ彉閲忎笉闇瑕佹椂錛屼笉闇鏄庢樉鐨勮涓簄ull錛屽洜涓轟竴涓柟娉曟墽琛屽畬姣曟椂錛岃繖浜涘紩鐢ㄤ細鑷姩琚竻鐞嗐?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆渚嬪瓙錛歷iew plain<span style="padding-bottom: 0px; line-height: 25px; padding-left: 5px; padding-right: 5px; float: left; height: 25px; padding-top: 0px">List myList=new ArrayList();for (int i=1;i<100; i++)</span></p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆{ Object o=new Object();myList.add(o);o=null;} //姝ゆ椂錛屾墍鏈夌殑Object瀵硅薄閮芥病鏈夎閲婃斁錛屽洜涓哄彉閲弇yList寮曠敤榪欎簺瀵硅薄銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆褰搈yList鍚庢潵涓嶅啀鐢ㄥ埌錛屽皢涔嬭涓簄ull錛岄噴鏀炬墍鏈夊畠寮曠敤鐨勫璞°備箣鍚嶨C渚夸細鍥炴敹榪欎簺瀵硅薄鍗犵敤鐨勫唴瀛樸?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆★ 瀵笹C鎿嶄綔瀵笹C鐨勬搷浣滃茍涓嶄竴瀹氳兘杈懼埌綆$悊鍐呭瓨鐨勬晥鏋溿?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆GC瀵逛簬紼嬪簭鍛樻潵璇村熀鏈槸閫忔槑鐨勶紝涓嶅彲瑙佺殑銆傛垜浠彧鏈夊嚑涓嚱鏁板彲浠ヨ闂瓽C錛屼緥濡傝繍琛孏C鐨勫嚱鏁癝ystem.gc()錛孲ystem.銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆浣嗘槸鏍規(guī)嵁Java璇█瑙勮寖瀹氫箟錛?System.gc()鍑芥暟涓嶄繚璇丣VM鐨勫瀮鍦炬敹闆嗗櫒涓瀹氫細鎵ц銆傚洜涓猴紝涓嶅悓鐨凧VM瀹炵幇鑰呭彲鑳戒嬌鐢ㄤ笉鍚岀殑綆楁硶綆$悊GC.閫氬父錛孏C鐨勭嚎紼嬬殑浼樺厛綰у埆杈冧綆銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆JVM璋冪敤GC鐨勭瓥鐣ユ湁寰堝縐嶏紝鏈夌殑鏄唴瀛樹嬌鐢ㄥ埌杈句竴瀹氱▼搴︽椂錛孏C鎵嶅紑濮嬪伐浣滐紝涔熸湁瀹氭椂鎵ц鐨勶紝鏈夌殑鏄鉤緙撴墽琛孏C錛屾湁鐨勬槸涓柇寮忔墽琛孏C.浣嗛氬父鏉ヨ錛屾垜浠笉闇瑕佸叧蹇冭繖浜涖傞櫎闈炲湪涓浜涚壒瀹氱殑鍦哄悎錛孏C鐨勬墽琛屽獎鍝嶅簲鐢ㄧ▼搴忕殑鎬ц兘錛屼緥濡傚浜庡熀浜嶹eb鐨勫疄鏃剁郴緇燂紝濡傜綉緇滄父鎴忕瓑錛岀敤鎴蜂笉甯屾湜GC紿佺劧涓柇搴旂敤紼嬪簭鎵ц鑰岃繘琛屽瀮鍦懼洖鏀訛紝閭d箞鎴戜滑闇瑕佽皟鏁碐C鐨勫弬鏁幫紝璁〨C鑳藉閫氳繃騫崇紦鐨勬柟寮忛噴鏀懼唴瀛橈紝渚嬪灝嗗瀮鍦懼洖鏀跺垎瑙d負涓緋誨垪鐨勫皬姝ラ鎵ц錛孲un鎻愪緵鐨凥otSpot JVM灝辨敮鎸佽繖涓鐗規(guī)с?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆★ 鍐呭瓨娉勯湶媯嫻嬪競鍦轟笂宸叉湁鍑犵涓撲笟媯鏌?strong>Java</strong>鍐呭瓨娉勬紡鐨勫伐鍏鳳紝瀹冧滑鐨勫熀鏈伐浣滃師鐞嗗ぇ鍚屽皬寮傦紝閮芥槸閫氳繃鐩戞祴Java紼嬪簭榪愯鏃訛紝鎵鏈夊璞$殑鐢寵銆侀噴鏀劇瓑鍔ㄤ綔錛屽皢鍐呭瓨綆$悊鐨勬墍鏈変俊鎭繘琛岀粺璁°佸垎鏋愩佸彲瑙嗗寲銆傚紑鍙戜漢鍛樺皢鏍規(guī)嵁榪欎簺淇℃伅鍒ゆ柇紼嬪簭鏄惁鏈夊唴瀛樻硠婕忛棶棰樸傝繖浜涘伐鍏峰寘鎷琌ptimizeit Profiler錛孞Probe Profiler錛孞inSight 錛?Rational 鍏徃鐨凱urify絳夈?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍦ㄨ繍琛岃繃紼嬩腑錛屾垜浠彲浠ラ殢鏃惰瀵熷唴瀛樼殑浣跨敤鎯呭喌錛岄氳繃榪欑鏂瑰紡錛屾垜浠彲浠ュ緢蹇壘鍒伴偅浜涢暱鏈熶笉琚噴鏀撅紝騫朵笖涓嶅啀浣跨敤鐨勫璞°傛垜浠氳繃媯鏌ヨ繖浜涘璞$殑鐢熷瓨鍛ㄦ湡錛岀‘璁ゅ叾鏄惁涓哄唴瀛樻硠闇層?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆★ 杞紩鐢ㄧ壒鐐癸細鍙湁褰撳唴瀛樹笉澶熺殑鏃跺欐墠鍥炴敹榪欑被鍐呭瓨錛屽悓鏃跺張淇濊瘉鍦↗ava鎶涘嚭OutOfMemory寮傚父涔嬪墠錛岃璁劇疆涓簄ull.淇濊瘉鏈澶ч檺搴︾殑浣跨敤鍐呭瓨鑰屼笉寮曡搗OutOfMemory寮傚父銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鍦ㄦ煇浜涙椂鍊欏杞紩鐢ㄧ殑浣跨敤浼氶檷浣庡簲鐢ㄧ殑榪愯鏁堢巼涓庢ц兘錛屼緥濡傦細搴旂敤杞紩鐢ㄧ殑瀵硅薄鐨勫垵濮嬪寲榪囩▼杈冧負鑰楁椂錛屾垨鑰呭璞$殑鐘舵佸湪紼嬪簭鐨勮繍琛岃繃紼嬩腑鍙戠敓浜嗗彉鍖栵紝閮戒細緇欓噸鏂板垱寤哄璞′笌鍒濆鍖栧璞″甫鏉ヤ笉鍚岀▼搴︾殑楹葷儲銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆鐢ㄩ旓細鍙互鐢ㄤ簬瀹炵幇涓浜涘父鐢ㄨ祫婧愮殑緙撳瓨錛屽疄鐜癈ache鐨勫姛鑳藉鐞嗕竴浜涘崰鐢ㄥ唴瀛樺ぇ鑰屼笖澹版槑鍛ㄦ湡杈冮暱錛屼絾浣跨敤騫朵笉棰戠箒鐨勫璞℃椂搴斿敖閲忓簲鐢ㄨ鎶鏈?#9733; java紼嬪簭璁捐涓湁鍏沖唴瀛樼鐞嗙殑緇忛獙1.鏈鍩烘湰鐨勫緩璁槸灝芥棭閲婃斁鏃犵敤瀵硅薄鐨勫紩鐢ㄣ傚錛歷iew plain<span style="padding-bottom: 0px; line-height: 25px; padding-left: 5px; padding-right: 5px; float: left; height: 25px; padding-top: 0px">……</span></p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆A a = new A();//搴旂敤a瀵硅薄a = null; //褰撲嬌鐢ㄥ璞涔嬪悗涓誨姩灝嗗叾璁劇疆涓虹┖…銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆娉細濡傛灉a 鏄柟娉曠殑榪斿洖鍊鹼紝涓嶈鍋氳繖鏍風殑澶勭悊錛屽惁鍒欎綘浠庤鏂規(guī)硶涓緱鍒扮殑榪斿洖鍊兼案榪滀負絀猴紝鑰屼笖榪欑閿欒涓嶆槗琚彂鐜般佹帓闄?.灝介噺灝戠敤finalize鍑芥暟銆傚畠浼氬姞澶C鐨勫伐浣滈噺銆?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆3.濡傛灉闇瑕佷嬌鐢ㄧ粡甯哥敤鍒扮殑鍥劇墖錛屽彲浠ヤ嬌鐢╯oft搴旂敤綾誨瀷銆傚畠?yōu)鍙兘鎶婂泟囦繚瀛樺湪鍐呭瓨涓?.娉ㄦ剰闆嗗悎鏁版嵁綾誨瀷錛屽寘鎷暟緇勩佹爲銆佸浘銆侀摼琛ㄧ瓑鏁版嵁緇撴瀯錛岃繖浜涙暟鎹粨鏋勫GC鏉ヨ錛屽洖鏀舵洿涓哄鏉傘?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆5.灝介噺閬垮厤鍦ㄧ被鐨勯粯璁ゆ瀯閫犲櫒涓垱寤恒佸垵濮嬪寲澶ч噺鐨勫璞★紝闃叉鍦ㄨ皟鐢ㄥ叾鑷被鐨勬瀯閫犲櫒鏃墮犳垚涓嶅繀瑕佺殑鍐呭瓨璧勬簮嫻垂6.灝介噺閬垮厤寮哄埗緋葷粺鍋氬瀮鍦懼唴瀛樼殑鍥炴敹錛屽闀跨郴緇熷仛鍨冨溇鍥炴敹鐨勬渶緇堟椂闂?.灝介噺閬垮厤鏄懼紡鐢寵鏁扮粍絀洪棿8.灝介噺鍋氳繙紼嬫柟娉曡皟鐢ㄧ被搴旂敤寮鍙戞椂浣跨敤鐬棿鍊煎彉閲忥紝闄ら潪榪滅▼璋冪敤绔渶瑕佽幏鍙栬鐬棿鍊煎彉閲忕殑鍊箋?/p> <p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 20px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px 瀹嬩綋; white-space: normal; color: rgb(51,51,51); border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px">銆銆9.灝介噺鍦ㄥ悎閫傜殑鍦烘櫙涓嬩嬌鐢ㄥ璞℃睜鎶鏈互鎻愰珮緋葷粺鎬ц兘銆?/p><img src ="http://www.tkk7.com/seosyw/aggbug/420376.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/seosyw/" target="_blank">钁h秴媧?/a> 2014-11-21 09:00 <a href="http://www.tkk7.com/seosyw/archive/2014/11/21/420376.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Java紼嬪簭榪炴帴鍚勭鏁版嵁搴撶殑鏂規(guī)硶http://www.tkk7.com/seosyw/archive/2014/10/28/419145.html钁h秴媧?/dc:creator>钁h秴媧?/author>Tue, 28 Oct 2014 14:15:00 GMThttp://www.tkk7.com/seosyw/archive/2014/10/28/419145.htmlhttp://www.tkk7.com/seosyw/comments/419145.htmlhttp://www.tkk7.com/seosyw/archive/2014/10/28/419145.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/419145.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/419145.html1銆丱racle8/8i/9i鏁版嵁搴擄紙鏁版嵁搴撳煿璁?/a> 鏁版嵁搴撹璇?/a> 錛?thin妯″紡)

銆銆Class.forName(“oracle.jdbc.driver.OracleDriver”).newInstance();

銆銆String url=“jdbc:oracle:thin錛欯localhost:1521:orcl”; //orcl涓烘暟鎹簱鐨凷ID

銆銆String user=“test”;

銆銆String password=“test”;

銆銆Connection conn= DriverManager.getConnection(url錛寀ser錛宲assword);

銆銆2銆丏B2鏁版嵁搴?/p>

銆銆Class.forName(“com.ibm.db2.jdbc.app.DB2Driver ”).newInstance();

銆銆String url=“jdbc:db2://localhost:5000/sample”; //sample涓轟綘鐨勬暟鎹簱鍚?/p>

銆銆String user=“admin”;

銆銆String password=“”;

銆銆Connection conn= DriverManager.getConnection(url錛寀ser錛宲assword);

銆銆3銆丼QL Server7.0/2000鏁版嵁搴?/p>

銆銆Class.forName(“com.microsoft.jdbc.sqlserver.SQLServerDriver”).newInstance();

銆銆String url=“jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb”;

銆銆//mydb涓烘暟鎹簱

銆銆String user=“sa”;

銆銆String password=“”;

銆銆Connection conn= DriverManager.getConnection(url錛寀ser錛宲assword);

銆銆4銆丼ybase鏁版嵁搴?/p>

銆銆Class.forName(“com.sybase.jdbc.SybDriver”).newInstance();

銆銆String url =“ jdbc:sybase:Tds:localhost:5007/myDB”;//myDB涓轟綘鐨勬暟鎹簱鍚?/p>

銆銆Properties sysProps = System.getProperties();

銆銆SysProps.put(“user”錛?#8220;userid”);

銆銆SysProps.put(“password”錛?#8220;user_password”);

銆銆Connection conn= DriverManager.getConnection(url錛?SysProps);

銆銆5銆両nformix鏁版嵁搴?/p>

銆銆Class.forName(“com.informix.jdbc.IfxDriver”).newInstance();

銆銆String url = “jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver;

銆銆user=testuser;password=testpassword”; //myDB涓烘暟鎹簱鍚?/p>

銆銆Connection conn= DriverManager.getConnection(url);

銆銆6銆丮ySQL鏁版嵁搴?/p>

銆銆Class.forName(“org.gjt.mm.mysql.Driver”).newInstance();

銆銆//鎴栬匔lass.forName(“com.mysql.jdbc.Driver”);

銆銆String url =“jdbc:mysql://localhost/myDB?

銆銆user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1”

銆銆//myDB涓烘暟鎹簱鍚?/p>

銆銆Connection conn= DriverManager.getConnection(url);

銆銆7銆丳ostgreSQL鏁版嵁搴?/p>

銆銆Class.forName(“org.postgresql.Driver”).newInstance();

銆銆String url =“jdbc:postgresql://localhost/myDB” //myDB涓烘暟鎹簱鍚?/p>

銆銆String user=“myuser”;

銆銆String password=“mypassword”;

銆銆Connection conn= DriverManager.getConnection(url錛寀ser錛宲assword);

銆銆8銆乤ccess鏁版嵁搴撶洿榪炵敤ODBC鐨?/p>

銆銆Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”) ;

銆銆String url=“jdbc:odbc:Driver={MicroSoft Access Driver

銆銆(*.mdb)};DBQ=”+application.getRealPath(“/Data/ReportDemo.mdb”);

銆銆Connection conn = DriverManager.getConnection(url錛?#8220;”錛?#8220;”);

銆銆Statement stmtNew=conn.createStatement() ;



]]>
瀹炵幇榧犳爣鐢誨浘鐨凧ava紼嬪簭http://www.tkk7.com/seosyw/archive/2014/10/28/419144.html钁h秴媧?/dc:creator>钁h秴媧?/author>Tue, 28 Oct 2014 14:14:00 GMThttp://www.tkk7.com/seosyw/archive/2014/10/28/419144.htmlhttp://www.tkk7.com/seosyw/comments/419144.htmlhttp://www.tkk7.com/seosyw/archive/2014/10/28/419144.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/419144.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/419144.htmlimport java.awt.Color;

銆銆import java.awt.Frame;

銆銆import java.awt.Graphics;

銆銆import java.awt.Point;

銆銆import java.awt.event.MouseAdapter;

銆銆import java.awt.event.MouseEvent;

銆銆import java.awt.event.MouseListener;

銆銆import java.util.ArrayList;

銆銆import java.util.Iterator;

銆銆public class MyMouseAdapter {

銆銆public static void main(String[] args) {

銆銆new MyFrame5(“drawing”);

銆銆}

銆銆}

銆銆class MyFrame5 extends Frame{

銆銆ArrayList points=null;

銆銆MyFrame5(String s){

銆銆super(s);

銆銆points=new ArrayList();

銆銆setLayout(null);

銆銆setBounds(300錛?00錛?00錛?00);

銆銆this.setBackground(new Color(204錛?04錛?55));

銆銆setVisible(true);

銆銆this.addMouseListener(new Monitor5());

銆銆}

銆銆public void paint(Graphics g){

銆銆Iterator i=points.iterator();

銆銆while(i.hasNext()){

銆銆Point p=(Point)i.next();

銆銆g.setColor(Color.blue);

銆銆g.fillOval(p.x錛宲.y錛?10錛?10);

銆銆}

銆銆}

銆銆public void addPoint(Point p){

銆銆points.add(p);

銆銆}

銆銆}

銆銆class Monitor5 extends MouseAdapter{ //MouseAdapter瀹炵幇浜哅ouseListener鎺ュ彛

銆銆public void mousePressed(MouseEvent e){

銆銆MyFrame5 f=(MyFrame5)e.getSource();

銆銆f.addPoint(new Point(e.getX()錛宔.getY()));

銆銆f.repaint(); //璁〧rame寮哄埗緇忚閲嶇敾

銆銆}

銆銆}



]]>
Java璁捐妯″紡涔媀isitor妯″紡http://www.tkk7.com/seosyw/archive/2014/10/28/419143.html钁h秴媧?/dc:creator>钁h秴媧?/author>Tue, 28 Oct 2014 14:13:00 GMThttp://www.tkk7.com/seosyw/archive/2014/10/28/419143.htmlhttp://www.tkk7.com/seosyw/comments/419143.htmlhttp://www.tkk7.com/seosyw/archive/2014/10/28/419143.html#Feedback0http://www.tkk7.com/seosyw/comments/commentRss/419143.htmlhttp://www.tkk7.com/seosyw/services/trackbacks/419143.htmlVisitor 瀹氫箟

銆銆浣滅敤浜庢煇涓璞$兢涓悇涓璞$殑鎿嶄綔銆?瀹冨彲浠ヤ嬌浣犲湪涓嶆敼鍙樿繖浜涘璞℃湰韜殑鎯呭喌涓嬶紝瀹氫箟浣滅敤浜庤繖浜涘璞$殑鏂版搷浣溿?/p>

銆銆鍦↗ava錛?a style="color: rgb(11,59,140); font-size: 12px; text-decoration: underline" target="_blank">Java鏁欑▼ Java鍩硅 錛?涓紝Visitor 妯″紡瀹為檯涓婃槸鍒嗙浜哻ollection 緇撴瀯涓殑鍏冪礌鍜屽榪欎簺鍏冪礌榪涜鎿嶄綔鐨勮涓恒?/p>

銆銆涓轟綍浣跨敤Visitor?

銆銆Java 鐨凜ollection(鍖呮嫭Vector 鍜孒ashtable)鏄垜浠渶緇忓父浣跨敤鐨勬妧鏈紝鍙槸Collection濂借薄鏄釜榛戣壊澶ф煋緙革紝鏈潵鏈夊悇縐嶉矞鏄庣被鍨嬬壒寰佺殑瀵硅薄涓鏃︽斁鍏ュ悗錛屽啀鍙栧嚭鏃訛紝榪欎簺綾誨瀷灝辨秷澶變簡銆傞偅涔堟垜浠娍蹇呰鐢↖f 鏉ュ垽鏂紝濡傦細

銆銆Iterator iterator = collection.iterator()

銆銆while (iterator.hasNext()) {

銆銆Object o = iterator.next();

銆銆if (o instanceof Collection)

銆銆messyPrintCollection((Collection)o);

銆銆else if (o instanceof String)

銆銆System.out.println(“‘”+o.toString()+“’”);

銆銆else if (o instanceof Float)

銆銆System.out.println(o.toString()+“f”);

銆銆else

銆銆System.out.println(o.toString());

銆銆}

銆銆鍦ㄤ笂渚嬩腑錛屾垜浠嬌鐢ㄤ簡 instanceof 鏉ュ垽鏂?o 鐨勭被鍨嬨?/p>

銆銆寰堟樉鐒訛紝榪欐牱鍋氱殑緙虹偣浠g爜If else if 寰堢箒鐞愩傛垜浠氨鍙互浣跨敤Visitor 妯″紡瑙e喅瀹冦?/p>

銆銆濡備綍浣跨敤Visitor?

銆銆閽堝涓婁緥錛屾垜浠璁′竴涓帴鍙isitor 璁塊棶鑰咃細

銆銆public interface Visitor

銆銆{

銆銆public void visitCollection(Collection collection);

銆銆public void visitString(String string);

銆銆public void visitFloat(Float float);

銆銆}

銆銆鍦ㄨ繖涓帴鍙d腑錛屽皢鎴戜滑璁や負Collection 鏈夊彲鑳界殑綾葷殑綾誨瀷鏀懼叆鍏朵腑銆?/p>

銆銆鏈変簡璁塊棶鑰咃紝鎴戜滑闇瑕佽璁塊棶鑰咃紝琚闂呭氨鏄垜浠珻ollection 鐨勬瘡涓厓绱燛lement錛屾垜浠涓鴻繖浜汦lement 瀹氫箟涓涓彲浠ユ帴鍙楄闂殑鎺ュ彛(璁塊棶鍜岃璁塊棶鏄簰鍔ㄧ殑錛屽彧鏈夎闂咃紝琚闂呭鏋滆〃紺轟笉嬈㈣繋錛岃闂呭氨涓嶈兘璁塊棶)錛屾垜浠畾涔夎繖涓帴鍙e彨Visitable錛?鐢ㄦ潵瀹氫箟涓涓狝ccept 鎿嶄綔錛屼篃灝辨槸璇磋Collection 姣忎釜鍏冪礌鍏峰鍙闂с?/p>

銆銆public interface Visitable

銆銆{

銆銆public void accept(Visitor visitor);

銆銆}

銆銆濂戒簡錛屾湁浜嗕袱涓帴鍙o紝鎴戜滑灝辮瀹氫箟浠栦滑鐨勫叿浣撳疄鐜?Concrete class)錛?/p>

銆銆public class ConcreteElement implements Visitable

銆銆{

銆銆private String value;

銆銆public ConcreteElement(String string) {

銆銆value = string;

銆銆}

銆銆//瀹氫箟accept 鐨勫叿浣撳唴瀹?榪欓噷鏄緢綆鍗曠殑涓鍙ヨ皟鐢?/p>

銆銆public void accept(Visitor visitor) {

銆銆visitor.visitString(this);

銆銆}

銆銆}

銆銆鍐嶇湅鐪嬭闂呯殑Concrete 瀹炵幇錛?/p>

銆銆public class ConcreteVisitor implements Visitor

銆銆{

銆銆//鍦ㄦ湰鏂規(guī)硶涓紝鎴戜滑瀹炵幇浜嗗Collection 鐨勫厓绱犵殑鎴愬姛璁塊棶

銆銆public void visitCollection(Collection collection) {

銆銆Iterator iterator = collection.iterator()

銆銆while (iterator.hasNext()) {

銆銆Object o = iterator.next();

銆銆if (o instanceof Visitable)

銆銆((Visitable)o).accept(this);

銆銆}

銆銆public void visitString(String string) {

銆銆System.out.println(“‘”+string+“’”);

銆銆}

銆銆public void visitFloat(Float float) {

銆銆System.out.println(float.toString()+“f”);

銆銆}

銆銆}

銆銆}

銆銆鍦ㄤ笂闈㈢殑visitCollection 鎴戜滑瀹炵幇浜嗗Collection 姣忎釜鍏冪礌璁塊棶錛屽彧浣跨敤浜嗕竴涓垽鏂鍙ワ紝鍙鍒ゆ柇鍏舵槸鍚﹀彲浠ヨ闂?/p>

銆銆鑷蟲錛屾垜浠畬鎴愪簡Visitor 妯″紡鍩烘湰鏋舵瀯銆?/p>

銆銆浣跨敤Visitor 妯″紡鐨勫墠鎻?/p>

銆銆瀵硅薄緹ょ粨鏋勪腑(Collection) 涓殑瀵硅薄綾誨瀷寰堝皯鏀瑰彉錛屼篃灝辨槸璇磋闂呯殑韜喚綾誨瀷寰堝皯鏀瑰彉錛屽涓婇潰涓璙isitor 涓殑綾誨瀷寰堝皯鏀瑰彉錛屽鏋滈渶瑕佸鍔犳柊鐨勬搷浣滐紝姣斿涓婁緥涓垜浠湪ConcreteElement 鍏蜂綋瀹炵幇澶栵紝榪橀渶瑕佹柊鐨凜oncreteElement2 ConcreteElement3.

銆銆鍙浣跨敤Visitor 妯″紡鏄湁鍓嶆彁鐨勶紝鍦ㄤ袱涓帴鍙isitor 鍜孷isitable 涓紝紜繚Visitor 寰堝皯鍙樺寲錛屽彉鍖栫殑鏄疺isitable錛岃繖鏍蜂嬌鐢╒isitor 鏈鏂逛究銆?/p>

銆銆濡傛灉Visitor 涔熺粡甯稿彉鍖栵紝 涔熷氨鏄錛屽璞$兢涓殑瀵硅薄綾誨瀷緇忓父鏀瑰彉錛屼竴鑸緩璁槸錛屼笉濡傚湪榪欎簺瀵硅薄綾諱腑閫愪釜瀹氫箟鎿嶄綔銆備絾鏄疛ava 鐨凴eflect 鎶鏈В鍐充簡榪欎釜闂銆?/p>

銆銆Reflect 鎶鏈槸鍦ㄨ繍琛屾湡闂村姩鎬佽幏鍙栧璞$被鍨嬪拰鏂規(guī)硶鐨勪竴縐嶆妧鏈紝鍏蜂綋瀹炵幇鍙傝僇avaworld鐨勮嫳鏂囧師鏂?



]]>
主站蜘蛛池模板: 亚洲欧美日韩一区二区三区 | 含羞草国产亚洲精品岁国产精品| 久久久精品2019免费观看 | 亚洲人成影院在线观看| 国产成人综合亚洲绿色| 国产国产成年年人免费看片| 亚洲老熟女五十路老熟女bbw| 欧洲精品成人免费视频在线观看| 久久精品九九亚洲精品| **俄罗斯毛片免费| 亚洲春色在线观看| 在线a级毛片免费视频| 亚洲中文字幕无码中文| 精品国产一区二区三区免费看| 在线观看日本亚洲一区| 国产成人在线免费观看| japanese色国产在线看免费| 国产亚洲精品美女久久久| 99久久精品国产免费| 亚洲精品国产电影午夜| 91嫩草免费国产永久入口| 亚洲H在线播放在线观看H| 免费AA片少妇人AA片直播| 色偷偷亚洲第一综合网| 亚洲午夜未满十八勿入网站2| A级毛片成人网站免费看| 久久精品国产96精品亚洲| 久久久免费的精品| 亚洲一区二区三区国产精华液| 亚洲成a人在线看天堂无码| 精品无码国产污污污免费网站国产 | 亚洲国产综合在线| 国产精品色午夜视频免费看| 中文字幕永久免费视频| 91亚洲性爱在线视频| 亚洲不卡AV影片在线播放| 在线观看的免费网站无遮挡| 日韩欧美亚洲国产精品字幕久久久 | 亚洲国产精品VA在线观看麻豆| 欧美三级在线电影免费| 一级午夜a毛片免费视频|