锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久亚洲精品影院,亚洲精品蜜桃久久久久久,亚洲区日韩精品中文字幕http://m.tkk7.com/jorwen/category/7238.htmlzh-cnWed, 28 Feb 2007 11:49:35 GMTWed, 28 Feb 2007 11:49:35 GMT60涓綃囦笉閿欑殑璁茶ВJava寮傚父鐨勬枃绔?/title><link>http://m.tkk7.com/jorwen/articles/29425.html</link><dc:creator>鏂逛匠鐜?/dc:creator><author>鏂逛匠鐜?/author><pubDate>Wed, 01 Feb 2006 04:36:00 GMT</pubDate><guid>http://m.tkk7.com/jorwen/articles/29425.html</guid><wfw:comment>http://m.tkk7.com/jorwen/comments/29425.html</wfw:comment><comments>http://m.tkk7.com/jorwen/articles/29425.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jorwen/comments/commentRss/29425.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jorwen/services/trackbacks/29425.html</trackback:ping><description><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent> <P><FONT size=2>鍏寮傚父澶勭悊鐨勯檵涔?/FONT></P> <P><FONT size=2>浣犺寰楄嚜宸辨槸涓涓狫ava涓撳鍚楋紵鏄惁鑲畾鑷繁宸茬粡鍏ㄩ潰鎺屾彙浜咼ava鐨勫紓甯稿鐞嗘満鍒訛紵鍦ㄤ笅闈㈣繖孌典唬鐮佷腑錛屼綘鑳藉榪呴熸壘鍑哄紓甯稿鐞嗙殑鍏釜闂鍚楋紵<BR><BR></P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"> OutputStreamWriter out </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> <IMG src="http://m.tkk7.com/images/dot.gif"> <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000"> java.sql.Connection conn </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> <IMG src="http://m.tkk7.com/images/dot.gif"> <BR><IMG id=Codehighlighter1_72_368_Open_Image onclick="this.style.display='none'; Codehighlighter1_72_368_Open_Text.style.display='none'; Codehighlighter1_72_368_Closed_Image.style.display='inline'; Codehighlighter1_72_368_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_72_368_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_72_368_Closed_Text.style.display='none'; Codehighlighter1_72_368_Open_Image.style.display='inline'; Codehighlighter1_72_368_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_72_368_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_72_368_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 鈶?nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000"> 銆Statement stat </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> conn.createStatement(); <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">5</SPAN><SPAN style="COLOR: #000000"> 銆ResultSet rs </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> stat.executeQuery( <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">6</SPAN><SPAN style="COLOR: #000000"> 銆銆</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">select uid, name from user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">); <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">7</SPAN><SPAN style="COLOR: #000000"> 銆</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000"> (rs.next()) <BR><IMG id=Codehighlighter1_224_320_Open_Image onclick="this.style.display='none'; Codehighlighter1_224_320_Open_Text.style.display='none'; Codehighlighter1_224_320_Closed_Image.style.display='inline'; Codehighlighter1_224_320_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_224_320_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_224_320_Closed_Text.style.display='none'; Codehighlighter1_224_320_Open_Image.style.display='inline'; Codehighlighter1_224_320_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">8</SPAN><SPAN style="COLOR: #000000"> 銆</SPAN><SPAN id=Codehighlighter1_224_320_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_224_320_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">9</SPAN><SPAN style="COLOR: #000000"> 銆銆out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ID錛?/SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> rs.getString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">uid</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 鈶?nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000"> 銆銆銆</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">錛屽鍚嶏細</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> rs.getString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)); <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">11</SPAN><SPAN style="COLOR: #000000"> 銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">12</SPAN><SPAN style="COLOR: #000000"> 銆conn.close(); </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 鈶?nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">13</SPAN><SPAN style="COLOR: #000000"> 銆out.close(); <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">14</SPAN><SPAN style="COLOR: #000000"> }</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">15</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(Exception ex) </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> 鈶?nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_403_442_Open_Image onclick="this.style.display='none'; Codehighlighter1_403_442_Open_Text.style.display='none'; Codehighlighter1_403_442_Closed_Image.style.display='inline'; Codehighlighter1_403_442_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_403_442_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_403_442_Closed_Text.style.display='none'; Codehighlighter1_403_442_Open_Image.style.display='inline'; Codehighlighter1_403_442_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">16</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_403_442_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_403_442_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">17</SPAN><SPAN style="COLOR: #000000"> 銆ex.printStackTrace(); </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">鈶達紝鈶?nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">18</SPAN><SPAN style="COLOR: #000000"> }</SPAN></SPAN></DIV></FONT></SPAN><BR><FONT size=2>浣滀負涓涓狫ava紼嬪簭鍛橈紝浣犺嚦灝戝簲璇ヨ兘澶熸壘鍑轟袱涓棶棰樸備絾鏄紝濡傛灉浣犱笉鑳芥壘鍑哄叏閮ㄥ叚涓棶棰橈紝璇風戶緇槄璇繪湰鏂囥?<BR><BR>銆銆鏈枃璁ㄨ鐨勪笉鏄疛ava寮傚父澶勭悊鐨勪竴鑸у師鍒欙紝鍥犱負榪欎簺鍘熷垯宸茬粡琚ぇ澶氭暟浜虹啛鐭ャ傛垜浠鍋氱殑鏄垎鏋愬悇縐嶅彲縐頒負鈥滃弽渚嬧濓紙anti-pattern錛夌殑榪濊儗浼樼緙栫爜瑙勮寖鐨勫父瑙佸潖涔犳儻錛屽府鍔╄鑰呯啛鎮夎繖浜涘吀鍨嬬殑鍙嶉潰渚嬪瓙錛屼粠鑰岃兘澶熷湪瀹為檯宸ヤ綔涓晱閿愬湴瀵熻鍜岄伩鍏嶈繖浜涢棶棰樸?<BR><BR>銆銆<B>鍙嶄緥涔嬩竴錛氫涪寮冨紓甯?</B><BR><BR>銆銆浠g爜錛?5琛?18琛屻?<BR><BR>銆銆榪欐浠g爜鎹曡幏浜嗗紓甯稿嵈涓嶄綔浠諱綍澶勭悊錛屽彲浠ョ畻寰椾笂Java緙栫▼涓殑鏉鎵嬨備粠闂鍑虹幇鐨勯綣佺▼搴﹀拰紲稿紼嬪害鏉ョ湅錛屽畠涔熻鍙互鍜孋/C++紼嬪簭鐨勪竴涓伓鍚嶈繙鎾殑闂鐩告彁騫惰??涓嶆鏌ョ紦鍐插尯鏄惁宸叉弧銆傚鏋滀綘鐪嬪埌浜嗚繖縐嶄涪寮冿紙鑰屼笉鏄姏鍑猴級寮傚父鐨勬儏鍐碉紝鍙互鐧懼垎涔嬩節鍗佷節鍦拌偗瀹氫唬鐮佸瓨鍦ㄩ棶棰橈紙鍦ㄦ瀬灝戞暟鎯呭喌涓嬶紝榪欐浠g爜鏈夊瓨鍦ㄧ殑鐞嗙敱錛屼絾鏈濂藉姞涓婂畬鏁寸殑娉ㄩ噴錛屼互鍏嶅紩璧峰埆浜鴻瑙o級銆?<BR><BR>銆銆榪欐浠g爜鐨勯敊璇湪浜庯紝寮傚父錛堝嚑涔庯級鎬繪槸鎰忓懗鐫鏌愪簺浜嬫儏涓嶅鍔蹭簡錛屾垨鑰呰鑷沖皯鍙戠敓浜嗘煇浜涗笉瀵誨父鐨勪簨鎯咃紝鎴戜滑涓嶅簲璇ュ紼嬪簭鍙戝嚭鐨勬眰鏁戜俊鍙蜂繚鎸佹矇榛樺拰鏃犲姩浜庤》銆傝皟鐢ㄤ竴涓媝rintStackTrace綆椾笉涓娾滃鐞嗗紓甯糕濄備笉閿欙紝璋冪敤printStackTrace瀵硅皟璇曠▼搴忔湁甯姪錛屼絾紼嬪簭璋冭瘯闃舵緇撴潫涔嬪悗錛宲rintStackTrace灝變笉搴斿啀鍦ㄥ紓甯稿鐞嗘ā鍧椾腑鎷呰礋涓昏璐d換浜嗐?<BR><BR>銆銆涓㈠純寮傚父鐨勬儏褰㈤潪甯告櫘閬嶃傛墦寮JDK鐨凾hreadDeath綾葷殑鏂囨。錛屽彲浠ョ湅鍒頒笅闈㈣繖孌佃鏄庯細鈥滅壒鍒湴錛岃櫧鐒跺嚭鐜癟hreadDeath鏄竴縐嶁樻甯哥殑鎯呭艦鈥欙紝浣員hreadDeath綾繪槸Error鑰屼笉鏄疎xception鐨勫瓙綾伙紝鍥犱負璁稿搴旂敤浼氭崟鑾鋒墍鏈夌殑Exception鐒跺悗涓㈠純瀹冧笉鍐嶇悊鐫傗濊繖孌佃瘽鐨勬剰鎬濇槸錛岃櫧鐒禩hreadDeath浠h〃鐨勬槸涓縐嶆櫘閫氱殑闂錛屼絾閴翠簬璁稿搴旂敤浼氳瘯鍥炬崟鑾鋒墍鏈夊紓甯哥劧鍚庝笉浜堜互閫傚綋鐨勫鐞嗭紝鎵浠DK鎶奣hreadDeath瀹氫箟鎴愪簡Error鐨勫瓙綾伙紝鍥犱負Error綾諱唬琛ㄧ殑鏄竴鑸殑搴旂敤涓嶅簲璇ュ幓鎹曡幏鐨勪弗閲嶉棶棰樸傚彲瑙侊紝涓㈠純寮傚父榪欎竴鍧忎範鎯槸濡傛甯歌錛屽畠鐢氳嚦宸茬粡褰卞搷鍒頒簡Java鏈韓鐨勮璁°?<BR><BR>銆銆閭d箞錛屽簲璇ユ庢牱鏀規鍛紵涓昏鏈夊洓涓夋嫨錛?<BR><BR>銆銆1銆佸鐞嗗紓甯搞傞拡瀵硅寮傚父閲囧彇涓浜涜鍔紝渚嬪淇闂銆佹彁閱掓煇涓漢鎴栬繘琛屽叾浠栦竴浜涘鐞嗭紝瑕佹牴鎹叿浣撶殑鎯呭艦紜畾搴旇閲囧彇鐨勫姩浣溿傚啀嬈¤鏄庯紝璋冪敤printStackTrace綆椾笉涓婂凡緇忊滃鐞嗗ソ浜嗗紓甯糕濄?<BR><BR>銆銆2銆侀噸鏂版姏鍑哄紓甯搞傚鐞嗗紓甯哥殑浠g爜鍦ㄥ垎鏋愬紓甯鎬箣鍚庯紝璁や負鑷繁涓嶈兘澶勭悊瀹冿紝閲嶆柊鎶涘嚭寮傚父涔熶笉澶變負涓縐嶉夋嫨銆?<BR><BR>銆銆3銆佹妸璇ュ紓甯歌漿鎹㈡垚鍙︿竴縐嶅紓甯搞傚ぇ澶氭暟鎯呭喌涓嬶紝榪欐槸鎸囨妸涓涓綆綰х殑寮傚父杞崲鎴愬簲鐢ㄧ駭鐨勫紓甯革紙鍏跺惈涔夋洿瀹規槗琚敤鎴蜂簡瑙g殑寮傚父錛夈?<BR><BR>銆銆4銆佷笉瑕佹崟鑾峰紓甯搞?<BR><BR>銆銆緇撹涓錛氭棦鐒舵崟鑾蜂簡寮傚父錛屽氨瑕佸瀹冭繘琛岄傚綋鐨勫鐞嗐備笉瑕佹崟鑾峰紓甯鎬箣鍚庡張鎶婂畠涓㈠純錛屼笉浜堢悊鐫?<BR><BR>銆銆<B>鍙嶄緥涔嬩簩錛氫笉鎸囧畾鍏蜂綋鐨勫紓甯?</B><BR><BR>銆銆浠g爜錛?5琛屻?<BR><BR>銆銆璁稿鏃跺欎漢浠細琚繖鏍蜂竴縐嶁滅編濡欑殑鈥濇兂娉曞惛寮曪細鐢ㄤ竴涓猚atch璇彞鎹曡幏鎵鏈夌殑寮傚父銆傛渶甯歌鐨勬儏褰㈠氨鏄嬌鐢╟atch(Exception ex)璇彞銆備絾瀹為檯涓婏紝鍦ㄧ粷澶у鏁版儏鍐典笅錛岃繖縐嶅仛娉曚笉鍊煎緱鎻愬°備負浠涔堝憿錛?<BR><BR>銆銆瑕佺悊瑙e叾鍘熷洜錛屾垜浠繀欏誨洖欏句竴涓媍atch璇彞鐨勭敤閫斻俢atch璇彞琛ㄧず鎴戜滑棰勬湡浼氬嚭鐜版煇縐嶅紓甯革紝鑰屼笖甯屾湜鑳藉澶勭悊璇ュ紓甯搞傚紓甯哥被鐨勪綔鐢ㄥ氨鏄憡璇塉ava緙栬瘧鍣ㄦ垜浠兂瑕佸鐞嗙殑鏄摢涓縐嶅紓甯搞傜敱浜庣粷澶у鏁板紓甯擱兘鐩存帴鎴栭棿鎺ヤ粠java.lang.Exception媧劇敓錛宑atch(Exception ex)灝辯浉褰撲簬璇存垜浠兂瑕佸鐞嗗嚑涔庢墍鏈夌殑寮傚父銆?<BR><BR>銆銆鍐嶆潵鐪嬬湅鍓嶉潰鐨勪唬鐮佷緥瀛愩傛垜浠湡姝f兂瑕佹崟鑾風殑寮傚父鏄粈涔堝憿錛熸渶鏄庢樉鐨勪竴涓槸SQLException錛岃繖鏄疛DBC鎿嶄綔涓父瑙佺殑寮傚父銆傚彟涓涓彲鑳界殑寮傚父鏄疘OException錛屽洜涓哄畠瑕佹搷浣淥utputStreamWriter銆傛樉鐒訛紝鍦ㄥ悓涓涓猚atch鍧椾腑澶勭悊榪欎袱縐嶆埅鐒朵笉鍚岀殑寮傚父鏄笉鍚堥傜殑銆傚鏋滅敤涓や釜catch鍧楀垎鍒崟鑾稴QLException鍜孖OException灝辮濂藉浜嗐傝繖灝辨槸璇達紝catch璇彞搴斿綋灝介噺鎸囧畾鍏蜂綋鐨勫紓甯哥被鍨嬶紝鑰屼笉搴旇鎸囧畾娑電洊鑼冨洿澶箍鐨凟xception綾匯?<BR><BR>銆銆鍙︿竴鏂歸潰錛岄櫎浜嗚繖涓や釜鐗瑰畾鐨勫紓甯革紝榪樻湁鍏朵粬璁稿寮傚父涔熷彲鑳藉嚭鐜般備緥濡傦紝濡傛灉鐢變簬鏌愮鍘熷洜錛宔xecuteQuery榪斿洖浜唍ull錛岃鎬庝箞鍔烇紵絳旀鏄瀹冧滑緇х畫鎶涘嚭錛屽嵆涓嶅繀鎹曡幏涔熶笉蹇呭鐞嗐傚疄闄呬笂錛屾垜浠笉鑳戒篃涓嶅簲璇ュ幓鎹曡幏鍙兘鍑虹幇鐨勬墍鏈夊紓甯革紝紼嬪簭鐨勫叾浠栧湴鏂硅繕鏈夋崟鑾峰紓甯哥殑鏈轟細??鐩磋嚦鏈鍚庣敱JVM澶勭悊銆?<BR><BR>銆銆緇撹浜岋細鍦╟atch璇彞涓敖鍙兘鎸囧畾鍏蜂綋鐨勫紓甯哥被鍨嬶紝蹇呰鏃朵嬌鐢ㄥ涓猚atch銆備笉瑕佽瘯鍥懼鐞嗘墍鏈夊彲鑳藉嚭鐜扮殑寮傚父銆?<BR><BR>銆銆<B>鍙嶄緥涔嬩笁錛氬崰鐢ㄨ祫婧愪笉閲婃斁 </B><BR><BR>銆銆浠g爜錛?琛?14琛屻?<BR><BR>銆銆寮傚父鏀瑰彉浜嗙▼搴忔甯哥殑鎵ц嫻佺▼銆傝繖涓亾鐞嗚櫧鐒剁畝鍗曪紝鍗村父甯歌浜轟滑蹇借銆傚鏋滅▼搴忕敤鍒頒簡鏂囦歡銆丼ocket銆丣DBC榪炴帴涔嬬被鐨勮祫婧愶紝鍗充嬌閬囧埌浜嗗紓甯革紝涔熻姝g‘閲婃斁鍗犵敤鐨勮祫婧愩備負姝わ紝Java鎻愪緵浜嗕竴涓畝鍖栬繖綾繪搷浣滅殑鍏抽敭璇峟inally銆?<BR><BR>銆銆finally鏄牱濂戒笢瑗匡細涓嶇鏄惁鍑虹幇浜嗗紓甯革紝Finally淇濊瘉鍦╰ry/catch/finally鍧楃粨鏉熶箣鍓嶏紝鎵ц娓呯悊浠誨姟鐨勪唬鐮佹繪槸鏈夋満浼氭墽琛屻傞仐鎲劇殑鏄湁浜涗漢鍗翠笉涔犳儻浣跨敤finally銆?<BR><BR>銆銆褰撶劧錛岀紪鍐檉inally鍧楀簲褰撳鍔犲皬蹇冿紝鐗瑰埆鏄娉ㄦ剰鍦╢inally鍧椾箣鍐呮姏鍑虹殑寮傚父??榪欐槸鎵ц娓呯悊浠誨姟鐨勬渶鍚庢満浼氾紝灝介噺涓嶈鍐嶆湁闅句互澶勭悊鐨勯敊璇?<BR><BR>銆銆緇撹涓夛細淇濊瘉鎵鏈夎祫婧愰兘琚紜噴鏀俱傚厖鍒嗚繍鐢╢inally鍏抽敭璇嶃?/FONT> <P><FONT size=2><STRONG>鍙嶄緥涔嬪洓錛氫笉璇存槑寮傚父鐨勮緇嗕俊鎭?<BR><BR></STRONG>銆銆浠g爜錛?琛?18琛屻?<BR><BR>銆銆浠旂粏瑙傚療榪欐浠g爜錛氬鏋滃驚鐜唴閮ㄥ嚭鐜頒簡寮傚父錛屼細鍙戠敓浠涔堜簨鎯咃紵鎴戜滑鍙互寰楀埌瓚沖鐨勪俊鎭垽鏂驚鐜唴閮ㄥ嚭閿欑殑鍘熷洜鍚楋紵涓嶈兘銆傛垜浠彧鑳界煡閬撳綋鍓嶆鍦ㄥ鐞嗙殑綾誨彂鐢熶簡鏌愮閿欒錛屼絾鍗翠笉鑳借幏寰椾換浣曚俊鎭垽鏂鑷村綋鍓嶉敊璇殑鍘熷洜銆?<BR><BR>銆銆printStackTrace鐨勫爢鏍堣窡韙姛鑳芥樉紺哄嚭紼嬪簭榪愯鍒板綋鍓嶇被鐨勬墽琛屾祦紼嬶紝浣嗗彧鎻愪緵浜嗕竴浜涙渶鍩烘湰鐨勪俊鎭紝鏈兘璇存槑瀹為檯瀵艱嚧閿欒鐨勫師鍥狅紝鍚屾椂涔熶笉鏄撹В璇匯?<BR><BR>銆銆鍥犳錛屽湪鍑虹幇寮傚父鏃訛紝鏈濂借兘澶熸彁渚涗竴浜涙枃瀛椾俊鎭紝渚嬪褰撳墠姝e湪鎵ц鐨勭被銆佹柟娉曞拰鍏朵粬鐘舵佷俊鎭紝鍖呮嫭浠ヤ竴縐嶆洿閫傚悎闃呰鐨勬柟寮忔暣鐞嗗拰緇勭粐printStackTrace鎻愪緵鐨勪俊鎭?<BR><BR>銆銆緇撹鍥涳細鍦ㄥ紓甯稿鐞嗘ā鍧椾腑鎻愪緵閫傞噺鐨勯敊璇師鍥犱俊鎭紝緇勭粐閿欒淇℃伅浣垮叾鏄撲簬鐞嗚В鍜岄槄璇匯?<BR><BR>銆銆<B>鍙嶄緥涔嬩簲錛氳繃浜庡簽澶х殑try鍧?</B><BR><BR>銆銆浠g爜錛?琛?14琛屻?<BR><BR>銆銆緇忓父鍙互鐪嬪埌鏈変漢鎶婂ぇ閲忕殑浠g爜鏀懼叆鍗曚釜try鍧楋紝瀹為檯涓婅繖涓嶆槸濂戒範鎯傝繖縐嶇幇璞′箣鎵浠ュ父瑙侊紝鍘熷洜灝卞湪浜庢湁浜涗漢鍥劇渷浜嬶紝涓嶆効鑺辨椂闂村垎鏋愪竴澶у潡浠g爜涓摢鍑犺浠g爜浼氭姏鍑哄紓甯搞佸紓甯哥殑鍏蜂綋綾誨瀷鏄粈涔堛傛妸澶ч噺鐨勮鍙ヨ鍏ュ崟涓法澶х殑try鍧楀氨璞℃槸鍑洪棬鏃呮父鏃舵妸鎵鏈夋棩甯哥敤鍝佸鍏ヤ竴涓ぇ綆卞瓙錛岃櫧鐒朵笢瑗挎槸甯︿笂浜嗭紝浣嗚鎵懼嚭鏉ュ彲涓嶅鏄撱?<BR><BR>銆銆涓浜涙柊鎵嬪父甯告妸澶ч噺鐨勪唬鐮佹斁鍏ュ崟涓猼ry鍧楋紝鐒跺悗鍐嶅湪catch璇彞涓0鏄嶦xception錛岃屼笉鏄垎紱誨悇涓彲鑳藉嚭鐜板紓甯哥殑孌佃惤騫跺垎鍒崟鑾峰叾寮傚父銆傝繖縐嶅仛娉曚負鍒嗘瀽紼嬪簭鎶涘嚭寮傚父鐨勫師鍥犲甫鏉ヤ簡鍥伴毦錛屽洜涓轟竴澶ф浠g爜涓湁澶鐨勫湴鏂瑰彲鑳芥姏鍑篍xception銆?<BR><BR>銆銆緇撹浜旓細灝介噺鍑忓皬try鍧楃殑浣撶Н銆?<BR><BR>銆銆<B>鍙嶄緥涔嬪叚錛氳緭鍑烘暟鎹笉瀹屾暣</B> <BR><BR>銆銆浠g爜錛?琛?11琛屻?<BR><BR>銆銆涓嶅畬鏁寸殑鏁版嵁鏄疛ava紼嬪簭鐨勯殣褰㈡潃鎵嬨備粩緇嗚瀵熻繖孌典唬鐮侊紝鑰冭檻涓涓嬪鏋滃驚鐜殑涓棿鎶涘嚭浜嗗紓甯革紝浼氬彂鐢熶粈涔堜簨鎯呫傚驚鐜殑鎵ц褰撶劧鏄琚墦鏂殑錛屽叾嬈★紝catch鍧椾細鎵ц??灝辮繖浜涳紝鍐嶄篃娌℃湁鍏朵粬鍔ㄤ綔浜嗐傚凡緇忚緭鍑虹殑鏁版嵁鎬庝箞鍔烇紵浣跨敤榪欎簺鏁版嵁鐨勪漢鎴栬澶囧皢鏀跺埌涓浠戒笉瀹屾暣鐨勶紙鍥犺屼篃鏄敊璇殑錛夋暟鎹紝鍗村緱涓嶅埌浠諱綍鏈夊叧榪欎喚鏁版嵁鏄惁瀹屾暣鐨勬彁紺恒傚浜庢湁浜涚郴緇熸潵璇達紝鏁版嵁涓嶅畬鏁村彲鑳芥瘮緋葷粺鍋滄榪愯甯︽潵鏇村ぇ鐨勬崯澶便?<BR><BR>銆銆杈冧負鐞嗘兂鐨勫緗姙娉曟槸鍚戣緭鍑鴻澶囧啓涓浜涗俊鎭紝澹版槑鏁版嵁鐨勪笉瀹屾暣鎬э紱鍙︿竴縐嶅彲鑳芥湁鏁堢殑鍔炴硶鏄紝鍏堢紦鍐茶杈撳嚭鐨勬暟鎹紝鍑嗗濂藉叏閮ㄦ暟鎹箣鍚庡啀涓嬈℃ц緭鍑恒?<BR><BR>銆銆緇撹鍏細鍏ㄩ潰鑰冭檻鍙兘鍑虹幇鐨勫紓甯鎬互鍙婅繖浜涘紓甯稿鎵ц嫻佺▼鐨勫獎鍝嶃?<BR><BR>銆銆<B>鏀瑰啓鍚庣殑浠g爜</B> <BR><BR>銆銆鏍規嵁涓婇潰鐨勮璁猴紝涓嬮潰緇欏嚭鏀瑰啓鍚庣殑浠g爜銆備篃璁告湁浜轟細璇村畠紼嶅井鏈夌偣?鍡︼紝浣嗘槸瀹冩湁浜嗘瘮杈冨畬澶囩殑寮傚父澶勭悊鏈哄埗銆?<BR></P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">OutputStreamWriter out </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> <IMG src="http://m.tkk7.com/images/dot.gif"> <BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>java.sql.Connection conn </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> <IMG src="http://m.tkk7.com/images/dot.gif"> <BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_66_288_Open_Image onclick="this.style.display='none'; Codehighlighter1_66_288_Open_Text.style.display='none'; Codehighlighter1_66_288_Closed_Image.style.display='inline'; Codehighlighter1_66_288_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_66_288_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_66_288_Closed_Text.style.display='none'; Codehighlighter1_66_288_Open_Image.style.display='inline'; Codehighlighter1_66_288_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_66_288_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_66_288_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆Statement stat </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> conn.createStatement(); <BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆ResultSet rs </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> stat.executeQuery( <BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">select uid, name from user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">); <BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000"> (rs.next()) <BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_203_285_Open_Image onclick="this.style.display='none'; Codehighlighter1_203_285_Open_Text.style.display='none'; Codehighlighter1_203_285_Closed_Image.style.display='inline'; Codehighlighter1_203_285_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_203_285_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_203_285_Closed_Text.style.display='none'; Codehighlighter1_203_285_Open_Image.style.display='inline'; Codehighlighter1_203_285_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆</SPAN><SPAN id=Codehighlighter1_203_285_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_203_285_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ID錛?/SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> rs.getString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">uid</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">錛屽鍚? </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> rs.getString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)); <BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(SQLException sqlex) <BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_318_405_Open_Image onclick="this.style.display='none'; Codehighlighter1_318_405_Open_Text.style.display='none'; Codehighlighter1_318_405_Closed_Image.style.display='inline'; Codehighlighter1_318_405_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_318_405_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_318_405_Closed_Text.style.display='none'; Codehighlighter1_318_405_Open_Image.style.display='inline'; Codehighlighter1_318_405_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_318_405_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_318_405_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">璀﹀憡錛氭暟鎹笉瀹屾暣</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">); <BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> ApplicationException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">璇誨彇鏁版嵁鏃跺嚭鐜癝QL閿欒</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, sqlex); <BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(IOException ioex) <BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_433_491_Open_Image onclick="this.style.display='none'; Codehighlighter1_433_491_Open_Text.style.display='none'; Codehighlighter1_433_491_Closed_Image.style.display='inline'; Codehighlighter1_433_491_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_433_491_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_433_491_Closed_Text.style.display='none'; Codehighlighter1_433_491_Open_Image.style.display='inline'; Codehighlighter1_433_491_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_433_491_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_433_491_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> ApplicationException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">鍐欏叆鏁版嵁鏃跺嚭鐜癐O閿欒</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, ioex); <BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_503_877_Open_Image onclick="this.style.display='none'; Codehighlighter1_503_877_Open_Text.style.display='none'; Codehighlighter1_503_877_Closed_Image.style.display='inline'; Codehighlighter1_503_877_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_503_877_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_503_877_Closed_Text.style.display='none'; Codehighlighter1_503_877_Open_Image.style.display='inline'; Codehighlighter1_503_877_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_503_877_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_503_877_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_525_692_Open_Image onclick="this.style.display='none'; Codehighlighter1_525_692_Open_Text.style.display='none'; Codehighlighter1_525_692_Closed_Image.style.display='inline'; Codehighlighter1_525_692_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_525_692_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_525_692_Closed_Text.style.display='none'; Codehighlighter1_525_692_Open_Image.style.display='inline'; Codehighlighter1_525_692_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> (conn </SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN id=Codehighlighter1_525_692_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_525_692_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_534_557_Open_Image onclick="this.style.display='none'; Codehighlighter1_534_557_Open_Text.style.display='none'; Codehighlighter1_534_557_Closed_Image.style.display='inline'; Codehighlighter1_534_557_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_534_557_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_534_557_Closed_Text.style.display='none'; Codehighlighter1_534_557_Open_Image.style.display='inline'; Codehighlighter1_534_557_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆銆</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_534_557_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_534_557_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆銆conn.close(); <BR></SPAN><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(SQLException sqlex2) <BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_592_688_Open_Image onclick="this.style.display='none'; Codehighlighter1_592_688_Open_Text.style.display='none'; Codehighlighter1_592_688_Closed_Image.style.display='inline'; Codehighlighter1_592_688_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_592_688_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_592_688_Closed_Text.style.display='none'; Codehighlighter1_592_688_Open_Image.style.display='inline'; Codehighlighter1_592_688_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆銆</SPAN><SPAN id=Codehighlighter1_592_688_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_592_688_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆銆System.err(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.getClass().getName() </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.mymethod - 涓嶈兘鍏抽棴鏁版嵁搴撹繛鎺? </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> sqlex2.toString()); <BR></SPAN><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">31</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">33</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_714_874_Open_Image onclick="this.style.display='none'; Codehighlighter1_714_874_Open_Text.style.display='none'; Codehighlighter1_714_874_Closed_Image.style.display='inline'; Codehighlighter1_714_874_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_714_874_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_714_874_Closed_Text.style.display='none'; Codehighlighter1_714_874_Open_Image.style.display='inline'; Codehighlighter1_714_874_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000"> (out </SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">) </SPAN><SPAN id=Codehighlighter1_714_874_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_714_874_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">34</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_723_745_Open_Image onclick="this.style.display='none'; Codehighlighter1_723_745_Open_Text.style.display='none'; Codehighlighter1_723_745_Closed_Image.style.display='inline'; Codehighlighter1_723_745_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_723_745_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_723_745_Closed_Text.style.display='none'; Codehighlighter1_723_745_Open_Image.style.display='inline'; Codehighlighter1_723_745_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆銆</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_723_745_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_723_745_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">35</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆銆out.close(); <BR></SPAN><SPAN style="COLOR: #008080">36</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">37</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(IOException ioex2) <BR></SPAN><SPAN style="COLOR: #008080">38</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_778_870_Open_Image onclick="this.style.display='none'; Codehighlighter1_778_870_Open_Text.style.display='none'; Codehighlighter1_778_870_Closed_Image.style.display='inline'; Codehighlighter1_778_870_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_778_870_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_778_870_Closed_Text.style.display='none'; Codehighlighter1_778_870_Open_Image.style.display='inline'; Codehighlighter1_778_870_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>銆銆</SPAN><SPAN id=Codehighlighter1_778_870_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_778_870_Open_Text><SPAN style="COLOR: #000000">{ <BR></SPAN><SPAN style="COLOR: #008080">39</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>銆銆銆System.err(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.getClass().getName() </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">.mymethod - 涓嶈兘鍏抽棴杈撳嚭鏂囦歡</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"> ioex2.toString()); <BR></SPAN><SPAN style="COLOR: #008080">40</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">41</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>銆}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR></SPAN><SPAN style="COLOR: #008080">42</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> </SPAN></DIV></FONT><BR><FONT size=2>鏈枃鐨勭粨璁轟笉鏄斁涔嬪洓嫻風殕鍑嗙殑鏁欐潯錛屾湁鏃跺父璇嗗拰緇忛獙鎵嶆槸鏈濂界殑鑰佸笀銆傚鏋滀綘瀵硅嚜宸辯殑鍋氭硶娌℃湁鐧懼垎涔嬬櫨鐨勪俊蹇冿紝鍔″繀鍔犱笂璇︾粏銆佸叏闈㈢殑娉ㄩ噴銆?<BR><BR>銆銆鍙︿竴鏂歸潰錛屼笉瑕佺瑧璇濊繖浜涢敊璇紝涓嶅Θ闂棶浣犺嚜宸辨槸鍚︾湡鍦板交搴曟憜鑴變簡榪欎簺鍧忎範鎯傚嵆浣挎渶鏈夌粡楠岀殑紼嬪簭鍛樺伓灝斾篃浼氳鍏ユ閫旓紝鍘熷洜寰堢畝鍗曪紝鍥犱負瀹冧滑紜‘瀹炲疄甯︽潵浜嗏滄柟渚庫濄傛墍鏈夎繖浜涘弽渚嬮兘鍙互鐪嬩綔Java緙栫▼涓栫晫鐨勬伓欖旓紝瀹冧滑緹庝附鍔ㄤ漢錛屾棤瀛斾笉鍏ワ紝鏃跺埢璇辨儜鐫浣犮備篃璁告湁浜轟細璁や負榪欎簺閮藉睘浜庨浮鐨挏姣涚殑灝忎簨錛屼笉瓚蟲寕榻匡紝浣嗚璁頒綇錛氬嬁浠ユ伓灝忚屼負涔嬶紝鍕夸互鍠勫皬鑰屼笉涓恒?</FONT><BR><img src ="http://m.tkk7.com/jorwen/aggbug/29425.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jorwen/" target="_blank">鏂逛匠鐜?/a> 2006-02-01 12:36 <a href="http://m.tkk7.com/jorwen/articles/29425.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java澶氱嚎紼嬭璁℃ā寮?/title><link>http://m.tkk7.com/jorwen/articles/29424.html</link><dc:creator>鏂逛匠鐜?/dc:creator><author>鏂逛匠鐜?/author><pubDate>Wed, 01 Feb 2006 04:34:00 GMT</pubDate><guid>http://m.tkk7.com/jorwen/articles/29424.html</guid><wfw:comment>http://m.tkk7.com/jorwen/comments/29424.html</wfw:comment><comments>http://m.tkk7.com/jorwen/articles/29424.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jorwen/comments/commentRss/29424.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jorwen/services/trackbacks/29424.html</trackback:ping><description><![CDATA[     鎽樿: java璇█宸茬粡鍐呯疆浜嗗綰跨▼鏀寔錛屾墍鏈夊疄鐜癛unnable鎺ュ彛鐨勭被閮藉彲琚惎鍔ㄤ竴涓柊綰跨▼錛屾柊綰跨▼浼氭墽琛岃瀹炰緥鐨剅un()鏂規硶錛屽綋run()鏂規硶鎵ц瀹屾瘯鍚庯紝綰跨▼灝辯粨鏉熶簡銆備竴鏃︿竴涓嚎紼嬫墽琛屽畬姣曪紝榪欎釜瀹炰緥灝變笉鑳藉啀閲嶆柊鍚姩錛屽彧鑳介噸鏂扮敓鎴愪竴涓柊瀹炰緥錛屽啀鍚姩涓涓柊綰跨▼銆俆hread綾繪槸瀹炵幇浜哛unnable鎺ュ彛鐨勪竴涓疄渚嬶紝瀹冧唬琛ㄤ竴涓嚎紼嬬殑瀹炰緥錛屽茍涓旓紝鍚姩綰跨▼鐨勫敮涓鏂規硶灝辨槸閫氳繃Thread綾葷殑start()瀹炰緥鏂?..  <a href='http://m.tkk7.com/jorwen/articles/29424.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/jorwen/aggbug/29424.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jorwen/" target="_blank">鏂逛匠鐜?/a> 2006-02-01 12:34 <a href="http://m.tkk7.com/jorwen/articles/29424.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓枃瀛楃涓查暱搴﹁綆?/title><link>http://m.tkk7.com/jorwen/articles/29423.html</link><dc:creator>鏂逛匠鐜?/dc:creator><author>鏂逛匠鐜?/author><pubDate>Wed, 01 Feb 2006 04:30:00 GMT</pubDate><guid>http://m.tkk7.com/jorwen/articles/29423.html</guid><wfw:comment>http://m.tkk7.com/jorwen/comments/29423.html</wfw:comment><comments>http://m.tkk7.com/jorwen/articles/29423.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jorwen/comments/commentRss/29423.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jorwen/services/trackbacks/29423.html</trackback:ping><description><![CDATA[<P> </P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">  StringLengthTest<BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_31_228_Open_Image onclick="this.style.display='none'; Codehighlighter1_31_228_Open_Text.style.display='none'; Codehighlighter1_31_228_Closed_Image.style.display='inline'; Codehighlighter1_31_228_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_31_228_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_31_228_Closed_Text.style.display='none'; Codehighlighter1_31_228_Open_Image.style.display='inline'; Codehighlighter1_31_228_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_31_228_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_31_228_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> main(String[] args) <BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_81_226_Open_Image onclick="this.style.display='none'; Codehighlighter1_81_226_Open_Text.style.display='none'; Codehighlighter1_81_226_Closed_Image.style.display='inline'; Codehighlighter1_81_226_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_81_226_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_81_226_Closed_Text.style.display='none'; Codehighlighter1_81_226_Open_Image.style.display='inline'; Codehighlighter1_81_226_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_81_226_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_81_226_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        String s </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">浣犲ソ鍟?/SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">length1: </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">s.length());<BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align=top>        System.out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">length2: </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">s.getBytes().length);<BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV> <P><BR>E:\>javac StringLengthTest.java<BR>E:\>java StringLengthTest</P> <P>length1: 3<BR>length2: 6<BR></P><img src ="http://m.tkk7.com/jorwen/aggbug/29423.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jorwen/" target="_blank">鏂逛匠鐜?/a> 2006-02-01 12:30 <a href="http://m.tkk7.com/jorwen/articles/29423.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://class3g.com" target="_blank">日本亚洲色大成网站www久久</a>| <a href="http://35469642.com" target="_blank">亚洲综合成人婷婷五月网址</a>| <a href="http://mogo321.com" target="_blank">色噜噜狠狠色综合免费视频</a>| <a href="http://xj47777.com" target="_blank">最新仑乱免费视频</a>| <a href="http://gkhnf.com" target="_blank">亚洲午夜福利在线视频</a>| <a href="http://77133144.com" target="_blank">日韩毛片免费无码无毒视频观看</a>| <a href="http://xianliwang.com" target="_blank">亚洲精品乱码久久久久久下载</a>| <a href="http://holdengong.com" target="_blank">天天爽亚洲中文字幕</a>| <a href="http://cytanhuang.com" target="_blank">中文在线日本免费永久18近</a>| <a href="http://am3736.com" target="_blank">四虎影视免费在线</a>| <a href="http://html5text.com" target="_blank">亚洲91av视频</a>| <a href="http://lemonbt.com" target="_blank">色哟哟国产精品免费观看</a>| <a href="http://xxxxxxxxcccc.com" target="_blank">四虎永久在线精品免费观看地址</a>| <a href="http://jkc178.com" target="_blank">国产精品亚洲综合天堂夜夜</a>| <a href="http://my77789.com" target="_blank">大学生一级毛片免费看</a>| <a href="http://www-8812.com" target="_blank">亚洲精品~无码抽插</a>| <a href="http://youkabaitiao.com" target="_blank">粉色视频成年免费人15次</a>| <a href="http://zjjtejia.com" target="_blank">免费二级毛片免费完整视频</a>| <a href="http://av56cc.com" target="_blank">一级毛片高清免费播放</a>| <a href="http://lzlcp.com" target="_blank">亚洲AV综合色区无码一区</a>| <a href="http://aplus178.com" target="_blank">91久久青青草原线免费</a>| <a href="http://0147222.com" target="_blank">亚洲国产成人片在线观看</a>| <a href="http://18yinren.com" target="_blank">日本免费久久久久久久网站</a>| <a href="http://ywgj50225.com" target="_blank">久久精品国产精品亚洲下载</a>| <a href="http://www73234.com" target="_blank">18禁亚洲深夜福利人口</a>| <a href="http://xianfeng-motor.com" target="_blank">国产免费不卡v片在线观看</a>| <a href="http://ymiwang.com" target="_blank">亚洲免费综合色在线视频</a>| <a href="http://jufandev.com" target="_blank">亚洲国产午夜福利在线播放</a>| <a href="http://46339cc.com" target="_blank">亚洲a无码综合a国产av中文</a>| <a href="http://www-c559.com" target="_blank">亚洲午夜福利精品久久</a>| <a href="http://mangshigas.com" target="_blank">一区二区三区福利视频免费观看</a>| <a href="http://58f8.com" target="_blank">国产成人亚洲综合无码精品</a>| <a href="http://6464k.com" target="_blank">222www在线观看免费</a>| <a href="http://9981tv.com" target="_blank">亚洲国产成人精品无码区二本</a>| <a href="http://whdysdt.com" target="_blank">精品亚洲成α人无码成α在线观看 </a>| <a href="http://qq-gm.com" target="_blank">美女扒开尿口给男人爽免费视频</a>| <a href="http://littlevv.com" target="_blank">在线亚洲精品福利网址导航</a>| <a href="http://044242.com" target="_blank">男女作爱免费网站</a>| <a href="http://zgj688.com" target="_blank">亚洲成网777777国产精品</a>| <a href="http://yuejiju.com" target="_blank">水蜜桃视频在线观看免费播放高清</a>| <a href="http://www-777768.com" target="_blank">久久久久亚洲AV无码专区首JN </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>