锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频一区二区三区,亚洲人成网站在线观看播放动漫,亚洲综合久久一本伊伊区http://www.tkk7.com/hiswing/archive/2006/08/30/66561.htmlhiswinghiswingWed, 30 Aug 2006 01:25:00 GMThttp://www.tkk7.com/hiswing/archive/2006/08/30/66561.htmlhttp://www.tkk7.com/hiswing/comments/66561.htmlhttp://www.tkk7.com/hiswing/archive/2006/08/30/66561.html#Feedback0http://www.tkk7.com/hiswing/comments/commentRss/66561.htmlhttp://www.tkk7.com/hiswing/services/trackbacks/66561.html棣栧厛璁╂垜浠潵澶嶄範涓嬩竴浠涔堟槸澶氱嚎紼嬶紵

銆銆澶氱嚎紼嬫槸榪欐牱涓縐嶆満鍒訛紝瀹冨厑璁稿湪紼嬪簭涓茍鍙戞墽琛屽涓寚浠ゆ祦錛屾瘡涓寚浠ゆ祦閮界О涓轟竴涓嚎紼嬶紝褰兼闂翠簰鐩哥嫭绔嬨?/p>

銆銆綰跨▼鍙堢О涓鴻交閲忕駭榪涚▼錛屽畠鍜岃繘紼嬩竴鏍鋒嫢鏈夌嫭绔嬬殑鎵ц鎺у埗錛岀敱鎿嶄綔緋葷粺璐熻矗璋冨害錛屽尯鍒湪浜庣嚎紼嬫病鏈夌嫭绔嬬殑瀛樺偍絀洪棿錛岃屾槸鍜屾墍灞炶繘紼嬩腑鐨勫叾瀹冪嚎紼嬪叡浜竴涓瓨鍌ㄧ┖闂達紝榪欎嬌寰楃嚎紼嬮棿鐨勯氫俊榪滆緝榪涚▼綆鍗曘?/p>

銆銆澶氫釜綰跨▼鐨勬墽琛屾槸騫跺彂鐨勶紝涔熷氨鏄湪閫昏緫涓娾滃悓鏃垛濓紝鑰屼笉綆℃槸鍚︽槸鐗╃悊涓婄殑鈥滃悓鏃垛濄傚鏋滅郴緇熷彧鏈変竴涓狢PU錛岄偅涔堢湡姝g殑鈥滃悓鏃垛濇槸涓嶅彲鑳界殑錛屼絾鏄敱浜嶤PU鐨勯熷害闈炲父蹇紝鐢ㄦ埛鎰熻涓嶅埌鍏朵腑鐨勫尯鍒紝鍥犳鎴戜滑涔熶笉鐢ㄥ叧蹇冨畠錛屽彧闇瑕佽鎯沖悇涓嚎紼嬫槸鍚屾椂鎵ц鍗沖彲銆?/p>

銆銆澶氱嚎紼嬪拰浼犵粺鐨勫崟綰跨▼鍦ㄧ▼搴忚璁′笂鏈澶х殑鍖哄埆鍦ㄤ簬錛岀敱浜庡悇涓嚎紼嬬殑鎺у埗嫻佸郊姝ょ嫭绔嬶紝浣垮緱鍚勪釜綰跨▼涔嬮棿鐨勪唬鐮佹槸涔卞簭鎵ц鐨勩?/p>

銆銆緇忚繃浠ヤ笂浠嬬粛錛屾兂蹇呭ぇ瀹墮兘宸茬粡鍥炲繂璧峰綋鏃跺啓澶氱嚎紼嬬▼搴忕殑鐥涜嫤銆傞偅涔堝啀璁╂垜浠洖蹇嗕竴涓嬶紝Java涓槸濡備綍瀹炵幇澶氱嚎紼嬬殑鍚с?/p>

銆銆浣滀負涓涓畬鍏ㄩ潰鍚戝璞$殑璇█錛孞ava鎻愪緵浜嗙被 java.lang.Thread 鏉ユ柟渚垮綰跨▼緙栫▼錛岃繖涓被鎻愪緵浜嗗ぇ閲忕殑鏂規硶鏉ユ柟渚挎垜浠帶鍒惰嚜宸辯殑鍚勪釜綰跨▼銆傝鎴戜滑鏉ョ湅涓鐪?Thread 綾匯俆hread 綾繪渶閲嶈鐨勬柟娉曟槸 run() 錛屽畠涓篢hread 綾葷殑鏂規硶 start() 鎵璋冪敤錛屾彁渚涙垜浠殑綰跨▼鎵瑕佹墽琛岀殑浠g爜銆備負浜嗘寚瀹氭垜浠嚜宸辯殑浠g爜錛屽彧闇瑕佽鐩栧畠錛?/p>

聽1 public class 聽MyThread聽 extends 聽Thread聽 {
聽2 聽聽聽聽聽聽聽聽 private int 聽index;
聽3 聽聽聽聽聽聽聽聽聽
聽4 聽聽聽聽聽聽聽聽 public 聽MyThread( int 聽i)聽 {
聽5 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 this .index聽 = 聽i;
聽6 聽聽聽聽聽聽聽聽}

聽7 聽聽聽聽聽聽聽聽
聽8 聽聽聽聽聽聽聽聽 public void 聽run()聽 {
聽9 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 while 聽( this .index聽 < 6 )聽 {
10 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println( " index聽=聽 " + this .index);
11
12 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 this .index ++ ;
13 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

14 聽聽聽聽聽聽聽聽}

15 聽聽聽聽聽聽聽聽
16 聽聽聽聽聽聽聽聽 public static void 聽main(String[]聽args)聽 {
17 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 for 聽( int 聽i聽 = 0 ;聽i聽 < 10 ;聽i ++ )聽 {
18 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 new 聽MyThread(i).start();
19 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

20 聽聽聽聽聽聽聽聽}

21 }

22

銆銆褰撶劧錛岄櫎浜嗕互涓婅繖縐嶆柟娉曪紝Java榪樻彁渚涗簡Runnable 鎺ュ彛銆傝鎺ュ彛鍙湁涓涓柟娉?run()錛屾垜浠0鏄庤嚜宸辯殑綾誨疄鐜?Runnable 鎺ュ彛騫舵彁渚涜繖涓鏂規硶錛屽皢綰跨▼浠g爜鍐欏叆鍏朵腑錛屽氨瀹屾垚浜嗚繖涓閮ㄥ垎鐨勪換鍔°備絾鏄?Runnable 鎺ュ彛騫舵病鏈変換浣曞綰跨▼鐨勬敮鎸侊紝鎴戜滑榪樺繀欏誨垱寤?Thread 綾葷殑瀹炰緥錛岃繖涓鐐歸氳繃 Thread 綾葷殑鏋勯犲嚱鏁版潵瀹炵幇銆?/p>

聽1 public class 聽MyThread聽 implements 聽Runnable聽 {
聽2 聽聽聽聽聽聽聽聽 private int 聽index;
聽3 聽聽聽聽聽聽聽聽聽
聽4 聽聽聽聽聽聽聽聽 public 聽MyThread( int 聽i)聽 {
聽5 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 this .index聽 = 聽i;
聽6 聽聽聽聽聽聽聽聽}

聽7 聽聽聽聽聽聽聽聽
聽8 聽聽聽聽聽聽聽聽 public void 聽run()聽 {
聽9 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 while 聽( this .index聽 < 6 )聽 {
10 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println( " index聽=聽 " + this .index);
11
12 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 this .index ++ ;
13 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

14 聽聽聽聽聽聽聽聽}

15 聽聽聽聽聽聽聽聽
16 聽聽聽聽聽聽聽聽 public static void 聽main(String[]聽args)聽 {
17 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 for 聽( int 聽i聽 = 0 ;聽i聽 < 10 ;聽i ++ )聽 {
18 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 new 聽Thread( new 聽MyThread(i)).start();
19 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

20 聽聽聽聽聽聽聽聽}

21 }

22
23


銆銆鎴戜滑宸茬粡涔犳儻浜嗕互涓婁袱縐嶇嚎紼嬬殑鏂規硶錛屼絾鏄紝Eclipse鐨剆wt鍗翠笉鐩稿悓銆傚鏋滄寜鐓ф垜浠互涓婄殑鏂規硶錛屽綋璁塊棶swt鐨勬煇涓緇勪歡鏃訛紝緋葷粺浼氭姏鍑哄紓甯革細org.eclipse.swt.SWTException: Invalid thread access 閭d箞錛屽湪swt涓紝濡備繚浣跨敤綰跨▼鍛紵

聽1 public class 聽MyThread聽 extends 聽Thread聽 {
聽2 聽聽聽聽 private 聽Display聽display;
聽3 聽聽聽聽 private 聽Label聽miniLabel;
聽4 聽聽聽聽
聽5 聽聽聽聽 private static int 聽index聽 = 0 ;聽
聽6
聽7 聽聽聽聽 public 聽MyThread(Display聽display,聽Label聽label)聽 {
聽8 聽聽聽聽聽聽聽聽 this .display聽 = 聽display;
聽9 聽聽聽聽聽聽聽聽 this .miniLabel聽 = 聽label;
10 聽聽聽聽}

11 聽聽聽聽
12 聽聽聽聽 public void 聽run()聽 {
13 聽聽聽聽聽聽聽聽 try {
14 聽聽聽聽聽聽聽聽聽聽聽聽 while 聽( true )聽 {
15 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Thread.sleep( 1000 );
16 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if 聽( ! this .display.isDisposed())聽 {
17 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Runnable聽runnable聽 = new 聽Runnable()聽 {
18 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 public void 聽run()聽 {
19 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 // 聽your聽source
20 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

21 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
;
22 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
23 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽display.asyncExec(runnable);聽 // 聽鍏抽敭鍦ㄨ繖涓鍙ヤ笂
24 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

25 聽聽聽聽聽聽聽聽聽聽聽聽}

26 聽聽聽聽聽聽聽聽}
catch 聽(Exception聽ex)聽 {}
27 聽聽聽聽}

28 }

swt鐨刣isplay鏈変袱縐嶆柟寮忓疄鐜扮嚎紼嬶細asyncExec鏄嚎紼嬪紓姝ョ殑錛宻yncExec鏄嚎紼嬪悓姝ョ殑銆?br />



hiswing 2006-08-30 09:25 鍙戣〃璇勮
]]>
紱佹閲嶅鍚姩http://www.tkk7.com/hiswing/archive/2006/08/10/62887.htmlhiswinghiswingThu, 10 Aug 2006 15:59:00 GMThttp://www.tkk7.com/hiswing/archive/2006/08/10/62887.htmlhttp://www.tkk7.com/hiswing/comments/62887.htmlhttp://www.tkk7.com/hiswing/archive/2006/08/10/62887.html#Feedback1http://www.tkk7.com/hiswing/comments/commentRss/62887.htmlhttp://www.tkk7.com/hiswing/services/trackbacks/62887.html
銆銆鍓嶄簺鏃ュ瓙鐢⊿WING涓烘湅鍙嬪啓浜嗕竴涓▼搴忥紝鍏朵腑灝辨湁涓嶅彲鍚屾椂鍚姩澶氫釜緋葷粺瀹炰緥鐨勮姹傘傜敱浜庢病鏈変竴涓ソ鐨勬濊礬錛屾墍浠ヨ蛋浜嗗緢澶氬集璺傜幇鍦ㄧ粓浜庤В鍐充簡錛岀Н绱簡涓浜涘績寰鋒兂涓庡ぇ瀹跺垎浜?br />
銆銆鍒濋亣璇ラ棶棰樻椂錛屾垜棣栧厛鎯沖埌鐨勬槸榪涚▼銆傚綋紼嬪簭鍚姩鏃跺垽鏂搷浣滅郴緇熶腑鏄惁瀛樺湪璇ヨ繘紼嬶紝濡傛灉瀛樺湪灝遍鍑哄惎鍔紝鍚﹀垯鍚姩紼嬪簭銆傝繖涓柟娉曞湪VB鎴朇璇█涓彲浠ラ氳繃璋冪敤WIN32 API鏉ュ疄鐜般傚湪JAVA涓紝瑕佹兂瀹炵幇璇ユ柟娉曟垨璁歌繕瑕佸熷姪C鐨勫姏閲忋傦紙瀵逛簬JAVA濡備綍鎹曡幏榪涚▼錛岃繕璇鋒壒璇勬寚姝c傦級

銆銆鏀懼純浜嗙涓縐嶆柟娉曪紝鎯沖埌浜嗗急鏅虹殑鏂規硶--閰嶇疆鏂囦歡銆傚綋緋葷粺絎竴嬈″惎鍔ㄦ椂灝嗘爣璇嗚緗負鍚姩涓紝閫鍑烘椂灝嗘爣璇嗚緗負鏈惎鍔ㄣ備絾寰堝揩灝卞彂鐜幫紝褰撻潪娉曞叧闂▼搴忥紙姣斿鍏蟲満鏃舵湭鍙婃椂鍏抽棴紼嬪簭錛夊悗錛屾垜浠殑紼嬪簭渚挎案榪滈暱鐪犱簡銆?br />
銆銆鍏跺疄錛屽湪璇ョ▼搴忎腑錛屾渶闄愬埗鎴戜滑鎬濊礬鐨勪究鏄?鍗曟満鐗?榪欎笁涓瓧銆傚畠緇欐垜浠殑鍗拌薄鏄粎渚涗竴鍙版満鍣ㄥ崟鐙嬌鐢紝涓庣綉緇滄棤鍏崇殑銆傚洜姝わ紝鎴戜滑寰堥毦灝嗘濊礬鏁寸悊鍒版湇鍔″櫒涓庡鎴鋒満涓幓銆備絾瑕佽В鍐寵闂鎭版伆瑕佺敤鍒版湇鍔″櫒涓庡鎴鋒満鐨勬蹇點傛兂鍍忎竴涓嬫垜浠鉤鏃跺惎鍔ㄧ數鑴戠殑姝ラ錛岄鍏堟寜涓嬪姞鐢碉紝鏈変簡鐢碉紝鐢佃剳鎵嶈兘鍚姩銆傛病閿欙紝鍙湁褰撶數鑴戞湭鍔犵數錛屼篃灝辨槸璇村綋鎴戜滑棣栨鍚姩鐢佃剳鏃舵墠浼氬仛榪欎釜鍔ㄤ綔錛岃屼笖榪欎釜鍔ㄤ綔鍦ㄤ竴孌墊椂闂村唴鍙細鍋氫竴嬈°傝嫢瑕侀噸鏂板姞鐢碉紝灝卞繀闇鍏堟柇鐢點傜幇鍦ㄥ洖鍒版垜浠殑紼嬪簭錛屾湁浜嗚繖涓濊礬錛岀暀緇欐垜浠殑闂灝辨槸璋佹潵鍏呭綋鐢電殑瑙掕壊鍛紵娌¢敊錛屽氨鏄箣鍓嶆彁鍒拌繃鐨勬湇鍔″櫒銆傜▼搴忛嬈″惎鍔ㄦ椂棣栧厛榪炴帴鎸囧畾绔彛鐨勬湇鍔″櫒錛屽彂鐜版湇鍔″櫒騫舵湭鍚姩錛屼簬鏄惎鍔ㄦ湇鍔″櫒錛屽惎鍔ㄧ▼搴忋傚綋紼嬪簭澶嶆暟鍚姩鏃訛紝鍐嶆榪炴帴鏈嶅姟鍣紝榪欐椂鍙戠幇鏈嶅姟鍣ㄥ凡緇忓惎鍔ㄤ簡錛屼簬鏄氨緇堟鍚姩銆備唬鐮佸涓嬶細

聽1publicclass聽Console聽{
聽2聽聽聽聽/**绔彛鍙?/span>*/
聽3聽聽聽聽privatestaticint聽iPort聽=50000;
聽4聽聽聽聽/**涓葷獥鍙?/span>*/
聽5聽聽聽聽JFrame聽frame聽=null;聽
聽6聽聽聽聽/**
聽7聽聽聽聽*聽緋葷粺鍏ュ彛
聽8聽聽聽聽*聽@param聽String[]聽args
聽9聽聽聽聽*聽*/

10聽聽聽聽publicstaticvoid聽main(String[]聽args)聽throws聽Exception聽{
11聽聽聽聽聽聽聽聽Socket聽socket聽=null;聽//瀹㈡埛绔繛鎺ュ櫒
12聽聽聽聽聽聽聽聽Thread聽thread聽=null;聽//鍚姩鏈嶅姟鍣ㄧ殑綰跨▼
13
14聽聽聽聽聽聽聽聽try{
15聽聽聽聽聽聽聽聽聽聽聽聽//榪炴帴鏈嶅姟鍣?br />16聽聽聽聽聽聽聽聽聽聽聽聽//濡傛灉鏈嶅姟鍣ㄦ湭鍚姩鍒欐姏寮傚父
17聽聽聽聽聽聽聽聽聽聽聽聽(socket聽=new聽Socket("localhost",聽iPort)).close();
18聽聽聽聽聽聽聽聽聽聽聽聽//濡傛灉鏈嶅姟鍣ㄥ凡緇忓惎鍔ㄥ垯閫鍑虹郴緇?/span>
19聽聽聽聽聽聽聽聽聽聽聽聽System.exit(0);
20聽聽聽聽聽聽聽聽}
catch聽(Exception聽e)聽{}//鏈仛澶勭悊
21
22聽聽聽聽聽聽聽聽//濡傛灉鏈嶅姟鍣ㄦ湭鍚姩鍒欏湪鏂扮殑綰跨▼涓惎鍔ㄦ湇鍔″櫒
23聽聽聽聽聽聽聽聽(thread聽=new聽Thread(new聽Server())).setDaemon(true);
24聽聽聽聽聽聽聽聽//寮濮嬬嚎紼?/span>
25聽聽聽聽聽聽聽聽thread.start();
26
27聽聽聽聽聽聽聽聽//鍚姩涓葷▼搴?/span>
28聽聽聽聽聽聽聽聽frame聽=new聽JFrame("瀛︽搗鏃犳動");
29聽聽聽聽聽聽聽聽frame.setVisible(true);
30聽聽聽聽}

31聽聽聽聽
32聽聽聽聽/**
33聽聽聽聽*聽绔彛鐩戝惉鏈嶅姟鍣ㄧ榪愯
34聽聽聽聽*聽@author聽hiswing
35聽聽聽聽*/

36聽聽聽聽staticclass聽Server聽implements聽Runnable聽{
37聽聽聽聽聽聽聽聽publicfinalvoid聽run()聽{
38聽聽聽聽聽聽聽聽聽聽聽聽ServerSocket聽serversocket聽=null;
39
40聽聽聽聽聽聽聽聽聽聽聽聽//鏌ユ壘娌℃湁鍗犵敤鐨勭鍙?/span>
41聽聽聽聽聽聽聽聽聽聽聽聽while聽(iPort聽<60000)聽{
42聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽try{
43聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽serversocket聽=new聽ServerSocket(iPort);
44聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
catch(Exception聽ex){
45聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽iPort++;
46聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

47聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽break;
48聽聽聽聽聽聽聽聽聽聽聽聽}

49聽聽聽聽聽聽聽聽聽聽聽聽try{
50聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽do{
51聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//鐩戝惉瀹㈡埛绔槸鍚︽湁榪炴帴
52聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽serversocket.accept();
53
54聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//紿楀彛鍦ㄤ換鍔℃爮闂姩
55聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(frame.getExtendedState()聽==1)聽{
56聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽frame.setExtendedState(0);
57聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

58聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if(frame.getExtendedState()聽!=1)聽{
59聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽frame.toFront();
60聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽frame.requestFocus();
61聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽frame.repaint();
62聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

63聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
while(true);
64聽聽聽聽聽聽聽聽聽聽聽聽}
catch聽(Exception聽ex)聽{
65聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//涓嶅仛澶勭悊
66聽聽聽聽聽聽聽聽聽聽聽聽}

67聽聽聽聽聽聽聽聽}

68聽聽聽聽}

69}

銆銆鐢變簬娌℃湁濂界殑鎬濊礬錛屼嬌鎴戜滑鍦ㄧ紪紼嬩腑璧頒簡璁稿寮礬錛屾氮璐逛簡瀹濊吹鐨勬椂闂淬傞兘璇磋蔣浠舵槸鏅烘収鐨勭粨鏅訛紝涓鐐規病閿欍?

hiswing 2006-08-10 23:59 鍙戣〃璇勮
]]>
Swt/JFace鍒跺仛緋葷粺鎵樼洏紼嬪簭http://www.tkk7.com/hiswing/archive/2006/08/09/62593.htmlhiswinghiswingWed, 09 Aug 2006 08:19:00 GMThttp://www.tkk7.com/hiswing/archive/2006/08/09/62593.htmlhttp://www.tkk7.com/hiswing/comments/62593.htmlhttp://www.tkk7.com/hiswing/archive/2006/08/09/62593.html#Feedback1http://www.tkk7.com/hiswing/comments/commentRss/62593.htmlhttp://www.tkk7.com/hiswing/services/trackbacks/62593.html
聽1//聽鍙栧緱緋葷粺鎵樼洏瀵硅薄
聽2final聽Tray聽tray聽=聽shell.getDisplay().getSystemTray();
聽3
聽4if聽(tray聽!=null)聽{
聽5聽聽聽聽聽聽聽聽//聽鐢熸垚鎵樼洏瀵硅薄
聽6聽聽聽聽聽聽聽聽final聽TrayItem聽item聽=new聽TrayItem(tray,聽SWT.NONE);
聽7聽聽聽聽聽聽聽聽//聽涓烘墭鐩樺璞℃坊鍔犻紶鏍囧仠鐣欐椂鐨勬枃瀛?/span>
聽8聽聽聽聽聽聽聽聽item.setToolTipText(鈥滃叚鏈堝ぉ鈥?;
聽9聽聽聽聽聽聽聽聽//聽涓烘墭鐩樻坊鍔犱簨浠?/span>
10聽聽聽聽聽聽聽聽item.addListener(SWT.Show,聽new聽Listener()聽{
11聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽handleEvent(Event聽event)聽{
12聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println("show");
13聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

14聽聽聽聽聽聽聽聽}
);
15聽聽聽聽聽聽聽聽item.addListener(SWT.Hide,聽new聽Listener()聽{
16聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽handleEvent(Event聽event)聽{
17聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println("hide");
18聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

19聽聽聽聽聽聽聽聽}
);
20聽聽聽聽聽聽聽聽item.addListener(SWT.Selection,聽new聽Listener()聽{
21聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽handleEvent(Event聽event)聽{
22聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println("selection");
23聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

24聽聽聽聽聽聽聽聽}
);
25聽聽聽聽聽聽聽聽item.addListener(SWT.DefaultSelection,聽new聽Listener()聽{
26聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽handleEvent(Event聽event)聽{
27聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println("default聽selection");
28聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

29聽聽聽聽聽聽聽聽}
);
30聽聽聽聽聽聽聽聽//聽涓烘墭鐩樺璞℃坊鍔犳樉紺虹敤鐨勫浘鏍?/span>
31聽聽聽聽聽聽聽聽item.setImage(image);
32聽聽聽聽聽聽聽聽//聽鐢熸垚鑿滃崟欏?/span>
33聽聽聽聽聽聽聽聽final聽Menu聽menu聽=new聽Menu(shell,聽SWT.POP_UP);
34聽聽聽聽聽聽聽聽MenuItem聽miShow聽=new聽MenuItem(menu,聽SWT.PUSH);
35聽聽聽聽聽聽聽聽miShow.setText("S&how");
36聽聽聽聽聽聽聽聽
37聽聽聽聽聽聽聽聽miShow.addSelectionListener(new聽SelectionListener()聽{
38聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽widgetSelected(SelectionEvent聽arg0)聽{
39聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽shell.setVisible(true);
40聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽shell.setMaximized(true);
41聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

42聽聽聽聽聽聽聽聽
43聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽widgetDefaultSelected(SelectionEvent聽arg0)聽{
44聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

45聽聽聽聽聽聽聽聽}
);
46聽聽聽聽聽聽聽聽
47聽聽聽聽聽聽聽聽MenuItem聽miExit聽=new聽MenuItem(menu,聽SWT.PUSH);
48聽聽聽聽聽聽聽聽miExit.setText("E&xit");
49聽聽聽聽聽聽聽聽
50聽聽聽聽聽聽聽聽miExit.addSelectionListener(new聽SelectionListener()聽{
51聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽widgetSelected(SelectionEvent聽arg0)聽{
52聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽exitAction.run();
53聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

54聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
55聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽widgetDefaultSelected(SelectionEvent聽arg0)聽{
56聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

57聽聽聽聽聽聽聽聽}
);
58聽聽聽聽聽聽聽聽
59聽聽聽聽聽聽聽聽//聽涓烘墭鐩樺璞℃坊鍔犱簨浠訛紝褰撳彸閿偣鍑誨浘鏍囨椂錛屾樉紺鴻彍鍗?/span>
60聽聽聽聽聽聽聽聽item.addListener(SWT.MenuDetect,聽new聽Listener()聽{
61聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽publicvoid聽handleEvent(Event聽event)聽{
62聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽menu.setVisible(true);
63聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}

64聽聽聽聽聽聽聽聽}
);
65}

鎬葷粨錛歴wt/jface涓簀ava紼嬪簭鍛樻彁渚涗簡蹇熷弽鏄犵殑鐣岄潰錛岀敱浜巗wt/jface鏈韓涔熸槸鍒╃敤JNI鏉ヨ皟鐢ㄧ郴緇熺殑鐣岄潰錛屾墍浠ュ湪瀹炵幇鐣岄潰鐨勫悓鏃朵篃涓虹▼搴忓憳鎻愪緵浜嗕竴浜涗笌鎿嶄綔緋葷粺浜や簰鐨勬柟娉曘傚埄鐢ㄨ繖浜涙柟娉曪紝鍙互寰堟柟渚垮揩鎹峰湴瀹屾垚鎴戜滑鐨勫姛鑳姐?br />
Eclipse鐨凢orms涔熼潪甯鎬笉閿欙紝鎻愪緵浜嗗崕涓界殑鐣岄潰錛屽啓鍑烘潵鐨勭▼搴忓氨濡傚悓緗戦〉涓鏍鳳紝褰撶劧瑕佹湁涓瀹氱殑瀹$編鐪煎厜錛屾湁鍏磋叮鐨勬湅鍙嬩笉浠跨爺絀剁爺絀躲?

hiswing 2006-08-09 16:19 鍙戣〃璇勮
]]>
Java Excel API鎿嶄綔Excel鐨勪竴涓棶棰?/title><link>http://www.tkk7.com/hiswing/archive/2006/08/04/61806.html</link><dc:creator>hiswing</dc:creator><author>hiswing</author><pubDate>Fri, 04 Aug 2006 09:46:00 GMT</pubDate><guid>http://www.tkk7.com/hiswing/archive/2006/08/04/61806.html</guid><wfw:comment>http://www.tkk7.com/hiswing/comments/61806.html</wfw:comment><comments>http://www.tkk7.com/hiswing/archive/2006/08/04/61806.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/hiswing/comments/commentRss/61806.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hiswing/services/trackbacks/61806.html</trackback:ping><description><![CDATA[銆銆浠婂ぉ涓篶fms緋葷粺澧炲姞浜嗚處紲ㄥ姛鑳斤紝灝嗗垪琛ㄤ腑鐨勬暟鎹鍏xcel鏂囦歡涓傚湪浠ュ墠鐢↗ava鎿嶄綔Excel鍗佸垎鍥伴毦錛屾渶甯哥敤鐨勬槸鐢熸垚CSV錛坈omma separated values錛夋枃浠訛紝鐒跺悗鐢‥xcel鎵撳紑璇ユ枃浠躲傝繖鏍峰彧鑳借鍙互璁塊棶鍒癊xcel鏂囦歡錛屼絾鏄繕涓嶈兘鐪熸鐨勬搷綰礒xcel鏂囦歡銆傝繕鏈夊皢鏁版嵁鐢熸垚xml錛屽茍鐢眝b鎴杤c鏉ヨ鍙栧茍鐢熸垚Excel鏂囦歡銆傝繖鏍鋒晥鐜囨樉鐒舵瘮杈冨樊銆侸ava Excel API鏄竴涓紑婧愰」鐩紝閫氳繃瀹僇ava寮鍙戜漢鍛樺彲浠ヨ鍙朎xcel鏂囦歡鐨勫唴瀹廣佸垱寤烘柊鐨凟xcel鏂囦歡銆佹洿鏂板凡緇忓瓨鍦ㄧ殑Excel鏂囦歡銆備嬌鐢ㄨAPI闈?Windows鎿嶄綔緋葷粺涔熷彲浠ラ氳繃綰疛ava搴旂敤鏉ュ鐞咵xcel鏁版嵁琛ㄣ備嬌鐢ㄥ畠鍙互鏂逛究鍦版搷綰礒xcel鏂囦歡銆傚叧浜嶫ava Excel API鐨勫熀鏈搷浣滃拰浣跨敤璇峰弬瑙佸埄鐢↗AVA鎿嶄綔EXCEL鏂囦歡錛庤繖閲岃ˉ鍏呬竴涓嬭嚜宸卞湪瀹為檯寮鍙戣繃紼嬩腑閬囧埌鐨勯棶棰樹互鍙婅В鍐蟲柟妗堛?br /><br />銆銆鍦ㄤ慨鏀笶xcel鏂囦歡鏃訛紝鐢變簬鏂囦歡鐨勫崟鍏冩牸鏈夊悇縐嶆牱寮?濡傦細杈規錛岃儗鏅瓑)錛屽湪鏇存柊鏃訛紝濡傛灉鐩存帴浣跨敤浠ヤ笅浠g爜鍒欎細鎶婂崟鍏冩牸鐨勬牱寮忚鐩栥?br /><div id="4iqmgqm" class="UBBPanel"><div id="aoakewc" class="UBBContent">//鐢熸垚鏂扮殑Label<br />jxl.write.Label labelC = new jxl.write.Label(0, 0, "This is a Label cell");<br />//灝唋abel鎻掑叆sheet涓?br />ws.addCell(labelC); </div></div><br />姝g‘鐨勫啓娉曞簲璇ュ涓嬶細<br /><div id="c44swua" class="UBBPanel"><div id="2sg4mu4" class="UBBContent">//榪欓噷鐨勬暟鎹被鍨嬩負瀛楃鍨嬶紝鑻ヤ負鍏跺畠綾誨瀷璇峰皢鍏惰漿涓烘紜殑綾誨瀷錛屽惁鍒欏嚭閿欍?br />jxl.write.Label labelC = (Label) sheet.getWritableCell(0, 0);<br />labelC.setString("This is a Label cell"); </div></div><br />鍦ㄥ埄鐢ㄥ涓嬩唬鐮佽繘琛屾嫹璐濇搷浣滄椂錛屾繪棤娉曟垚鍔熴?br /><div id="eqmymk4" class="UBBPanel"><div id="2ey4i44" class="UBBContent">jxl.write.Label labelC.copyTo(0, 1)錛?</div></div><br />鍘熷洜鏄鎿嶄綔鍙槸鐢熸垚浜唋abelC鐨勪竴涓壇鏈紝騫舵病鏈夌湡姝f彃鍏heet涓傛紜殑鍋氭硶濡備笅錛?br /><div id="2aeau4k" class="UBBPanel"><div id="ea24mg6" class="UBBContent">sheet.addCell(jxl.write.Label labelC.copyTo(0, 1)); </div></div><br />銆銆浠ュ墠鐢╟om鎿嶄綔Excel錛岀獊鐒朵嬌鐢↗ava Excel API榪樼湡鏈夌偣涓嶉傚簲銆傛渶涓昏鐨勫尯鍒繕鏄湪鎬濊礬涓娿傛垜鎰熻鐩墠Java Excel API鍔熻兘榪樹笉鏄緢寮哄ぇ錛屾搷浣滆搗鏉ラ潪甯稿鏉傦紝榪橀渶鏀硅繘銆俢om涓琛屼唬鐮佸氨鍙畬鎴愮殑鍔熻兘錛屽湪榪欓噷闇瑕佸啓N琛屻傝瘽鍙堣鍥炴潵錛屾湁璋佹瘮Microsoft鏇翠簡瑙d粬浠嚜宸辯殑涓滆タ鍛紵 <img src ="http://www.tkk7.com/hiswing/aggbug/61806.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hiswing/" target="_blank">hiswing</a> 2006-08-04 17:46 <a href="http://www.tkk7.com/hiswing/archive/2006/08/04/61806.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓閬搄ava棰橈紝浣犺兘鍋氬鍚楋紵http://www.tkk7.com/hiswing/archive/2006/08/01/61151.htmlhiswinghiswingTue, 01 Aug 2006 03:17:00 GMThttp://www.tkk7.com/hiswing/archive/2006/08/01/61151.htmlhttp://www.tkk7.com/hiswing/comments/61151.htmlhttp://www.tkk7.com/hiswing/archive/2006/08/01/61151.html#Feedback11http://www.tkk7.com/hiswing/comments/commentRss/61151.htmlhttp://www.tkk7.com/hiswing/services/trackbacks/61151.html
publicclass聽Test聽{
聽聽聽聽
publicstaticvoid聽main(String[]聽args)聽{
聽聽聽聽聽聽聽聽
int聽i聽=11;
聽聽聽聽聽聽聽聽i聽
+=聽i++;

聽聽聽聽聽聽聽聽System.out.println(i);
聽聽聽聽}

}
璇風粰鍑虹瓟妗堝悗鑷繁榪愯涓閬嶃傝寰楋紝瑕佸厛緇欏嚭絳旀鍐嶈繍琛屻?img src ="http://www.tkk7.com/hiswing/aggbug/61151.html" width = "1" height = "1" />

hiswing 2006-08-01 11:17 鍙戣〃璇勮
]]>
java鍏嬮殕璇﹁堪-涓?/title><link>http://www.tkk7.com/hiswing/archive/2006/07/27/60440.html</link><dc:creator>hiswing</dc:creator><author>hiswing</author><pubDate>Thu, 27 Jul 2006 15:32:00 GMT</pubDate><guid>http://www.tkk7.com/hiswing/archive/2006/07/27/60440.html</guid><wfw:comment>http://www.tkk7.com/hiswing/comments/60440.html</wfw:comment><comments>http://www.tkk7.com/hiswing/archive/2006/07/27/60440.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/hiswing/comments/commentRss/60440.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hiswing/services/trackbacks/60440.html</trackback:ping><description><![CDATA[浣曚負褰卞瓙clone錛熷厛鐪嬩竴涓嬩緥瀛愩?br /><div id="gc4a4yo" class="UBBPanel"><div id="sg4sqg6" class="UBBTitle"><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://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍊掗湁鐨勭緤</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">聽2</span><span style="COLOR: #008000"><img id="Codehighlighter1_46_288_Open_Image" onclick="this.style.display='none'; Codehighlighter1_46_288_Open_Text.style.display='none'; Codehighlighter1_46_288_Closed_Image.style.display='inline'; Codehighlighter1_46_288_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_46_288_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_46_288_Closed_Text.style.display='none'; Codehighlighter1_46_288_Open_Image.style.display='inline'; Codehighlighter1_46_288_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽Sheep聽</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">聽Cloneable</span><span id="Codehighlighter1_46_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_46_288_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽3</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">聽String聽name;<br /></span><span style="COLOR: #008080">聽4</span><span style="COLOR: #000000"><img id="Codehighlighter1_109_135_Open_Image" onclick="this.style.display='none'; Codehighlighter1_109_135_Open_Text.style.display='none'; Codehighlighter1_109_135_Closed_Image.style.display='inline'; Codehighlighter1_109_135_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_109_135_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_109_135_Closed_Text.style.display='none'; Codehighlighter1_109_135_Open_Image.style.display='inline'; Codehighlighter1_109_135_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽setName(String聽arg)聽</span><span id="Codehighlighter1_109_135_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_109_135_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽5</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽name聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽arg;<br /></span><span style="COLOR: #008080">聽6</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">聽7</span><span style="COLOR: #000000"><img id="Codehighlighter1_165_190_Open_Image" onclick="this.style.display='none'; Codehighlighter1_165_190_Open_Text.style.display='none'; Codehighlighter1_165_190_Closed_Image.style.display='inline'; Codehighlighter1_165_190_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_165_190_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_165_190_Closed_Text.style.display='none'; Codehighlighter1_165_190_Open_Image.style.display='inline'; Codehighlighter1_165_190_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽String聽getName()聽</span><span id="Codehighlighter1_165_190_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_165_190_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽8</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽name;<br /></span><span style="COLOR: #008080">聽9</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img id="Codehighlighter1_252_286_Open_Image" onclick="this.style.display='none'; Codehighlighter1_252_286_Open_Text.style.display='none'; Codehighlighter1_252_286_Closed_Image.style.display='inline'; Codehighlighter1_252_286_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_252_286_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_252_286_Closed_Text.style.display='none'; Codehighlighter1_252_286_Open_Image.style.display='inline'; Codehighlighter1_252_286_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Object聽clone()聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽CloneNotSupportedException聽</span><span id="Codehighlighter1_252_286_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_252_286_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">super</span><span style="COLOR: #000000">.clone();<br /></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">緹婂湀</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">15</span><span style="COLOR: #008000"><img id="Codehighlighter1_339_527_Open_Image" onclick="this.style.display='none'; Codehighlighter1_339_527_Open_Text.style.display='none'; Codehighlighter1_339_527_Closed_Image.style.display='inline'; Codehighlighter1_339_527_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_339_527_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_339_527_Closed_Text.style.display='none'; Codehighlighter1_339_527_Open_Image.style.display='inline'; Codehighlighter1_339_527_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽Sheepfold聽</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">聽Cloneable聽</span><span id="Codehighlighter1_339_527_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_339_527_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Sheep聽sheep;<br /></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽String聽name;<br /></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img id="Codehighlighter1_406_435_Open_Image" onclick="this.style.display='none'; Codehighlighter1_406_435_Open_Text.style.display='none'; Codehighlighter1_406_435_Closed_Image.style.display='inline'; Codehighlighter1_406_435_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_406_435_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_406_435_Closed_Text.style.display='none'; Codehighlighter1_406_435_Open_Image.style.display='inline'; Codehighlighter1_406_435_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Sheepfold()聽</span><span id="Codehighlighter1_406_435_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_406_435_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽sheep聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽Sheep();<br /></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img id="Codehighlighter1_495_525_Open_Image" onclick="this.style.display='none'; Codehighlighter1_495_525_Open_Text.style.display='none'; Codehighlighter1_495_525_Closed_Image.style.display='inline'; Codehighlighter1_495_525_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_495_525_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_495_525_Closed_Text.style.display='none'; Codehighlighter1_495_525_Open_Image.style.display='inline'; Codehighlighter1_495_525_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Object聽clone()聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽CloneNotSupportedException聽</span><span id="Codehighlighter1_495_525_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_495_525_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">super</span><span style="COLOR: #000000">.clone();<br /></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍏嬮殕</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">26</span><span style="COLOR: #008000"><img id="Codehighlighter1_552_1335_Open_Image" onclick="this.style.display='none'; Codehighlighter1_552_1335_Open_Text.style.display='none'; Codehighlighter1_552_1335_Closed_Image.style.display='inline'; Codehighlighter1_552_1335_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_552_1335_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_552_1335_Closed_Text.style.display='none'; Codehighlighter1_552_1335_Open_Image.style.display='inline'; Codehighlighter1_552_1335_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽Main聽</span><span id="Codehighlighter1_552_1335_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_552_1335_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img id="Codehighlighter1_612_1333_Open_Image" onclick="this.style.display='none'; Codehighlighter1_612_1333_Open_Text.style.display='none'; Codehighlighter1_612_1333_Closed_Image.style.display='inline'; Codehighlighter1_612_1333_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_612_1333_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_612_1333_Closed_Text.style.display='none'; Codehighlighter1_612_1333_Open_Image.style.display='inline'; Codehighlighter1_612_1333_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.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)聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽Exception聽</span><span id="Codehighlighter1_612_1333_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_612_1333_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽Sheepfold聽fold聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽Sheepfold();<br /></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽fold.name聽</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">30</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽fold.sheep.setName(</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">31</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽Sheepfold聽fold2聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(Sheepfold)fold.clone();<br /></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽fold2.name聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold2.name);<br /></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽fold2.sheep.getName()聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold2.sheep.getName());<br /></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽fold2.name聽</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">35</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽fold2.sheep.setName(</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">36</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.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">37</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽fold2.name聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold2.name);<br /></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">*聽fold2.sheep.getName()聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold2.sheep.getName());<br /></span><span style="COLOR: #008080">39</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽fold.name聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold.name);<br /></span><span style="COLOR: #008080">40</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">*聽fold.sheep.getName()聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽fold.sheep.getName());<br /></span><span style="COLOR: #008080">41</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽System.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">42</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div></div></div><br />銆銆鍦ㄨ繖涓緥瀛愪腑鏈変笁涓被錛孲heep鍜孲heepflod閮藉疄鐜頒簡Cloneable鎺ュ彛錛屽茍涓旇鍐欎簡Object綾葷殑clone鏂規硶錛岃鏄庤繖涓や釜綾繪槸鍏鋒湁鍏嬮殕鑳藉姏鐨勩傛敞鎰忎竴鐐癸紝鍦⊿heepflod涓寔鏈変竴涓猄heep鐨勫疄渚嬶紝騫跺湪Main綾諱腑瀵瑰叾榪涜鍏嬮殕錛岀粨鏋滃涓嬶細<br />fold2.name = 灝忕緤鍦?br />fold2.sheep.getName() = 灝忕緤<br />=====================================<br />fold2.name = 澶х緤鍦?br />* fold2.sheep.getName() = 澶х緤<br />fold.name = 灝忕緤鍦?br />* fold.sheep.getName() = 澶х緤<br />===================================== <br /><br />銆銆璇鋒敞鎰忎竴涓嬬粨鏋滀腑甯︽湁"*"鍙風殑涓ゆ潯緇撴灉璇彞銆俧old2.sheep鍜宖old.sheep鐨刵ame閮藉彉涓轟簡"澶х緤"錛屽緢濂囨槸鍚楋紵鍦ㄦ涔嬪墠錛屾垜浠彧瀵筬old2.sheep鐨刵ame璧嬭繃鍊箋備負浠涔坒old.sheep鐨刵ame涔熷彉涓轟簡"澶х緤"鍛紵鍘熷洜寰堢畝鍗曪紝鍥犱負瀹冧滑鏄寚鍚戝悓涓涓璞$殑涓嶅悓寮曠敤銆備粠涓彲浠ョ湅鍑猴紝璋冪敤Object綾諱腑clone()鏂規硶鏃訛紝棣栧厛鍦ㄥ唴瀛樹腑鍒掑垎涓鍧楀悓鍘熷璞$浉鍚岀殑絀洪棿錛岀劧鍚庡皢鍘熷璞$殑鍐呭鍘熸牱鎷瘋礉鑷蟲柊瀵硅薄銆傛垜浠煡閬擄紝java涓湁鍩烘湰鏁版嵁綾誨瀷錛屽浜庡熀鏈暟鎹被鍨嬶紝榪欐牱鐨勬搷浣滄槸娌℃湁闂鐨勶紝浣嗗闈炲熀鏈被鍨嬪彉閲忥紝瀹冧滑淇濆瓨鐨勪粎浠呮槸瀵硅薄鐨勫紩鐢紝榪欎篃鏄負浠涔坈lone鍚庨潪鍩烘湰綾誨瀷鍙橀噺鍜屽師瀵硅薄涓殑鍙橀噺鎸囧悜鍚屼竴涓璞$殑鍘熷洜銆傚彲鑳戒綘宸茬粡娉ㄦ剰鍒幫紝紼嬪簭涓敤鍒頒簡String綾誨瀷錛屽嵆瀵硅薄錛屼負浠涔堟病鏈夊嚭鐜板紩鐢ㄦ寚鍚戝悓涓鍦板潃鐨勬儏鍐碉紵榪欐槸鍥犱負String鏄竴涓笉鍙洿鏀圭殑綾伙紙immutable class錛夛紝姣忔緇欏畠璧嬪兼椂錛岄兘浼氫駭鐢熶竴涓柊鐨凷tring瀵硅薄銆傚String str = "a"; str += "b";鍦ㄨ繖涓ゅ彞浠g爜涓紝褰撴墽琛宻tr += "b"鏃訛紝瀹為檯涓婃槸閲嶆柊鎴愮敓浜嗕竴涓間負"ab"鐨凷tring瀵硅薄錛屽嵆閲嶆柊鍒嗛厤浜嗕竴鍧楀唴瀛樼┖闂淬備互涓奵lone鏂規硶閫氬父琚О涓?褰卞瓙clone"銆?褰卞瓙clone"緇欐垜浠暀涓嬩簡涓涓棶棰橈紝鍗沖涓紩鐢ㄦ寚鍚戝悓涓涓璞°傚浣曡В鍐寵闂鍛紵絳旀涓?娣卞害clone"銆傛妸涓婇潰鐨勪緥瀛愭敼鎴愭繁搴lone寰堢畝鍗曪紝鍙渶灝哠heepfold鐨刢lone()鏂規硶鏀逛負濡備笅鍗沖彲錛?br /><div id="yug2u46" class="UBBPanel"><div id="e4q4cwy" class="UBBTitle"><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 id="Codehighlighter1_56_161_Open_Image" onclick="this.style.display='none'; Codehighlighter1_56_161_Open_Text.style.display='none'; Codehighlighter1_56_161_Closed_Image.style.display='inline'; Codehighlighter1_56_161_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_56_161_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_56_161_Closed_Text.style.display='none'; Codehighlighter1_56_161_Open_Image.style.display='inline'; Codehighlighter1_56_161_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Object聽clone()聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽CloneNotSupportedException聽</span><span id="Codehighlighter1_56_161_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_56_161_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">2</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽Sheepfold聽fold聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(Sheepfold)</span><span style="COLOR: #0000ff">super</span><span style="COLOR: #000000">.clone();<br /></span><span style="COLOR: #008080">3</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽sheep聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(Sheep)fold.sheep.clone();<br /></span><span style="COLOR: #008080">4</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽fold;<br /></span><span style="COLOR: #008080">5</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000">聽</span></div></div></div><br />銆銆鑷蟲錛宑lone灝卞熀鏈畬鎴愪簡銆傚綋鐒訛紝鍦ㄥ疄闄呬嬌鐢ㄨ繃紼嬩腑闇瑕佹敞鎰忎竴浜涢棶棰橈紝姣斿StringBuffer涓嶅彲浠ョ洿鎺lone錛堝綋鐒訛紝涔熸湁瑙e喅鍔炴硶錛夌瓑絳夈?br /><br />銆銆瀹岋紒 <br /><br />銆銆2004-09-01<img src ="http://www.tkk7.com/hiswing/aggbug/60440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hiswing/" target="_blank">hiswing</a> 2006-07-27 23:32 <a href="http://www.tkk7.com/hiswing/archive/2006/07/27/60440.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java鍏嬮殕璇﹁堪-涓?/title><link>http://www.tkk7.com/hiswing/archive/2006/07/27/60438.html</link><dc:creator>hiswing</dc:creator><author>hiswing</author><pubDate>Thu, 27 Jul 2006 15:24:00 GMT</pubDate><guid>http://www.tkk7.com/hiswing/archive/2006/07/27/60438.html</guid><wfw:comment>http://www.tkk7.com/hiswing/comments/60438.html</wfw:comment><comments>http://www.tkk7.com/hiswing/archive/2006/07/27/60438.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.tkk7.com/hiswing/comments/commentRss/60438.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hiswing/services/trackbacks/60438.html</trackback:ping><description><![CDATA[銆銆鍦ㄤ粖澶╃殑宸ヤ綔涓紝涓轟簡瑙e喅瀵硅薄鍦板潃鐨勯棶棰橈紝浣跨敤浜唈ava鐨刢lone銆備絾鍙戠幇鏈変簺鍚屼簨绔熺劧瀵筩lone寰堟槸涓嶆槑鐧斤紝鐢氳嚦瀵?寮曠敤"(reference)涔熸槸涓澶撮浘姘淬傝繖浜涢兘鏄痡ava鏈鍩虹鐨勬蹇碉紝涔熸槸鏈閲嶈鐨勶紝鏄垜浠湪瀛︿範java鏃跺繀欏婚浼氱殑銆?br /><br />銆銆緇忓父鍚埌鏈変漢璇磈ava涓病鏈夋寚閽堛備簨瀹炲姝ゅ悧錛焠o錛宩ava鏄湁鎸囬拡鐨勶紝鍙笉榪囨崲浜嗕釜鍚嶅瓧鑰屽凡錛屼篃灝辨槸鎴戜滑緇忓父鎻愬埌鐨勫紩鐢ㄣ傛垜浠煡閬擄紝鍦╦ava涓竴鍒囬兘鏄璞★紝閭d箞鎴戜滑濡備綍鎿嶆帶瀵硅薄錛熷浣曞湪鎴愬崈涓婁竾鐨勫璞′腑鎵懼埌鎴戜滑鎵闇鐨勯偅涓璞″憿錛熷張鏄浣曡瀵硅薄鎸夌収鎴戜滑鐨勬剰鎬濇潵瀹屾垚浠誨姟鐨勫憿錛?br />銆銆Object o = new Object(); <br /><br />銆銆榪欐槸java涓渶甯歌鐨勮鍙ヤ簡錛屽湪榪欏彞璇濅腑鍋氫簡涓変歡浜嬨傞鍏堝0鏄庝竴涓狾bject綾誨瀷鐨勫彉閲弌錛屽湪鍐呭瓨涓負瀵硅薄鍒掑垎涓鍧楀湴鍧new Object()錛屽皢澹版槑鐨勫彉閲忔寚鍚戝唴瀛樹腑鐨勫璞°傚姝や竴鏉ワ紝鎴戜滑灝卞彲浠ラ氳繃o鏉ユ搷綰靛璞′簡銆傚氨濂藉儚瀛╁瓙浠帺鐨勯仴鎺ч鏈猴紝鍦ㄧ┖涓琛岀殑鏄鏈猴紝鑰屼嬌瀹冨仛鍑轟紭緹庡姩浣滅殑鍗存槸瀛╁瓙浠墜涓殑鎽囨帶鍣ㄣ?br /><br />銆銆"鍏嬮殕"鏄浠婂惉鍒扮殑杈冨鐨勮瘝姹囷紝鍚宸茬粡灝嗘煇鍙緤鍏嬮殕浜嗗ソ鍑犱喚浜嗐備絾鎰胯繖縐嶆妧鏈笉瑕佸湪浜鴻韓涓婂疄楠屻俲ava涓篃鏈?鍏嬮殕"錛屼笌鐜板疄涓栫晫鐨勫厠闅嗕竴鏍鳳紝灝嗕竴涓疄闄呭瓨鍦ㄧ殑瀵硅薄鎷瘋礉鍑犱喚銆傚涓嬶細<br /><div id="wyye442" class="UBBPanel"><div id="q4om4ec" class="UBBTitle">聽</div><div id="2u4444i" class="UBBContent"><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://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍊掗湁鐨勭緤</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">聽2</span><span style="COLOR: #008000"><img id="Codehighlighter1_46_292_Open_Image" onclick="this.style.display='none'; Codehighlighter1_46_292_Open_Text.style.display='none'; Codehighlighter1_46_292_Closed_Image.style.display='inline'; Codehighlighter1_46_292_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_46_292_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_46_292_Closed_Text.style.display='none'; Codehighlighter1_46_292_Open_Image.style.display='inline'; Codehighlighter1_46_292_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽Sheep聽</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">聽Cloneable</span><span id="Codehighlighter1_46_292_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_46_292_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽3</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">聽String聽name;<br /></span><span style="COLOR: #008080">聽4</span><span style="COLOR: #000000"><img id="Codehighlighter1_109_135_Open_Image" onclick="this.style.display='none'; Codehighlighter1_109_135_Open_Text.style.display='none'; Codehighlighter1_109_135_Closed_Image.style.display='inline'; Codehighlighter1_109_135_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_109_135_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_109_135_Closed_Text.style.display='none'; Codehighlighter1_109_135_Open_Image.style.display='inline'; Codehighlighter1_109_135_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽setName(String聽arg)聽</span><span id="Codehighlighter1_109_135_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_109_135_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽5</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽name聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽arg;<br /></span><span style="COLOR: #008080">聽6</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">聽7</span><span style="COLOR: #000000"><img id="Codehighlighter1_165_192_Open_Image" onclick="this.style.display='none'; Codehighlighter1_165_192_Open_Text.style.display='none'; Codehighlighter1_165_192_Closed_Image.style.display='inline'; Codehighlighter1_165_192_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_165_192_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_165_192_Closed_Text.style.display='none'; Codehighlighter1_165_192_Open_Image.style.display='inline'; Codehighlighter1_165_192_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽String聽getName()聽</span><span id="Codehighlighter1_165_192_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_165_192_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">聽8</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽name;<br /></span><span style="COLOR: #008080">聽9</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img id="Codehighlighter1_254_290_Open_Image" onclick="this.style.display='none'; Codehighlighter1_254_290_Open_Text.style.display='none'; Codehighlighter1_254_290_Closed_Image.style.display='inline'; Codehighlighter1_254_290_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_254_290_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_254_290_Closed_Text.style.display='none'; Codehighlighter1_254_290_Open_Image.style.display='inline'; Codehighlighter1_254_290_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽Object聽clone()聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽CloneNotSupportedException聽</span><span id="Codehighlighter1_254_290_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_254_290_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">super</span><span style="COLOR: #000000">.clone();<br /></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍏嬮殕</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">15</span><span style="COLOR: #008000"><img id="Codehighlighter1_317_693_Open_Image" onclick="this.style.display='none'; Codehighlighter1_317_693_Open_Text.style.display='none'; Codehighlighter1_317_693_Closed_Image.style.display='inline'; Codehighlighter1_317_693_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_317_693_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_317_693_Closed_Text.style.display='none'; Codehighlighter1_317_693_Open_Image.style.display='inline'; Codehighlighter1_317_693_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽Main聽</span><span id="Codehighlighter1_317_693_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_317_693_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img id="Codehighlighter1_396_691_Open_Image" onclick="this.style.display='none'; Codehighlighter1_396_691_Open_Text.style.display='none'; Codehighlighter1_396_691_Closed_Image.style.display='inline'; Codehighlighter1_396_691_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_396_691_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_396_691_Closed_Text.style.display='none'; Codehighlighter1_396_691_Open_Image.style.display='inline'; Codehighlighter1_396_691_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.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)聽</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">聽CloneNotSupportedException聽</span><span id="Codehighlighter1_396_691_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://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_396_691_Open_Text"><span style="COLOR: #000000">{<br /></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽Sheep聽sheep聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽Sheep();聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍏堝緱鍒伴偅鍙緤鐨勫疄渚?/span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">18</span><span style="COLOR: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽聽聽聽聽sheep.setName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">鎴戞槸鐪熺殑</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">緇欏畠鍋氫釜璁板彿</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">19</span><span style="COLOR: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">sheep.getName()聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽sheep.getName());<br /></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽Sheep聽sheepClone聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(Sheep)sheep.clone();聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">寮濮嬪厠闅?/span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">21</span><span style="COLOR: #008000"><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽聽聽聽聽聽聽聽System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">sheepClone.getName()聽=聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽sheepClone.getName());<br /></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span></span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000">聽</span></div></div></div><br />榪愯紼嬪簭緇撴灉涓猴細<br />sheep.getName() = 鎴戞槸鐪熺殑<br />sheepClone.getName() = 鎴戞槸鐪熺殑<br /><br />銆銆涓ゅ彧緹婃槸涓妯′竴鏍風殑錛堝摢鎬曢偅鍙緤鐦歌吙錛夈傝鎴戜滑鏉ョ湅鐪嬩唬鐮併傞鍏堣娉ㄦ剰鐨勬槸Sheep綾誨疄鐜頒簡Cloneable鎺ュ彛錛堣鎺ュ彛灞炰簬java.lang鍖咃紝榛樿宸茬粡瀵煎叆浜嗭級錛岃鎺ュ彛涓茍娌℃湁瀹氫箟瑕佸疄鐜扮殑鏂規硶錛屾槸涓┖鎺ュ彛錛岃搗鏍囧織浣滅敤銆備篃灝辨槸璇達紝瀹炵幇浜嗚繖涓帴鍙g殑緹婂氨涓嶅啀鏄彧鏅氱殑緹婏紝瀹冩槸涓鍙彲浠ヨ鍏嬮殕鐨勭緤銆傚啀寰涓嬬湅錛屾湁涓猚lone鏂規硶錛岃繑鍥濷bject綾誨瀷鐨勫璞★紝騫舵姏鍑篊loneNotSupportedException寮傚父銆傝鏂規硶瑕嗗啓浜嗙埗綾?Object)鐨刢lone鏂規硶錛屽茍鍦ㄦ渶鍚庤皟鐢ㄤ簡super.clone()錛岃繖涔熸剰鍛崇潃鏃犺clone綾葷戶鎵跨粨鏋勬槸浠涔堟牱鐨勶紝super.clone()閮戒細鐩存帴鎴栭棿鎺ヨ皟鐢∣bject綾葷殑clone()鏂規硶銆傜湅鐪媕dk甯姪鏂囨。浼氬彂鐜幫紝Object綾葷殑clone()鏄竴涓猲ative鏂規硶錛屾垜浠煡閬擄紝native鏂規硶鐨勬晥鐜囦竴鑸潵璇撮兘鏄繙楂樹簬java涓殑闈瀗ative鏂規硶銆傝繖涔熻鏄庝簡new涓涓璞★紝鐒跺悗灝嗗師瀵硅薄涓殑鏁版嵁瀵煎叆鍒版柊鍒涘緩鐨勫璞′腑鍘葷殑鍋氭硶鏄涔堟剼锠€傚繀欏昏鏄庣殑鏄疧bject涓殑clone鏂規硶鏄痯rotected鐨勶紝鎵浠ヨ浣跨敤clone灝卞繀欏葷戶鎵縊bject綾伙紙榛樿錛夈傚茍涓斾負浜嗗彲浠ヤ嬌鍏跺畠綾昏皟鐢ㄨ鏂規硶錛屽繀欏誨皢鍏朵綔鐢ㄥ煙璁劇疆涓簆ublic銆?br /><br />銆銆浠ヤ笂鍙槸涓涓畝鍗昪lone鐨勫疄鐜般傛槑澶╄璇?褰卞瓙clone"鍜?娣卞害clone"銆?br /><br />銆銆澶滐紝娣變簡銆?<br /><br />銆銆2004-08-31<img src ="http://www.tkk7.com/hiswing/aggbug/60438.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hiswing/" target="_blank">hiswing</a> 2006-07-27 23:24 <a href="http://www.tkk7.com/hiswing/archive/2006/07/27/60438.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://7755ga.com" target="_blank">亚洲av成人中文无码专区</a>| <a href="http://wwwtoutoulu.com" target="_blank">成人免费黄色网址</a>| <a href="http://zgfxshop.com" target="_blank">香蕉视频在线观看免费</a>| <a href="http://whdy888.com" target="_blank">亚洲国产成人久久</a>| <a href="http://aicbbs.com" target="_blank">亚洲天堂视频在线观看</a>| <a href="http://hlyidc.com" target="_blank">国产精品V亚洲精品V日韩精品</a>| <a href="http://doubaye.com" target="_blank">四虎影院免费视频</a>| <a href="http://www676617.com" target="_blank">国产妇乱子伦视频免费</a>| <a href="http://my55572.com" target="_blank">a毛片免费全部播放完整成</a>| <a href="http://xixidhw.com" target="_blank">免费精品国产自产拍在线观看</a>| <a href="http://sjzbosite.com" target="_blank">亚洲jjzzjjzz在线播放</a>| <a href="http://cin17.com" target="_blank">91在线精品亚洲一区二区</a>| <a href="http://lemonbt.com" target="_blank">久久亚洲国产欧洲精品一</a>| <a href="http://zhongxueping888.com" target="_blank">亚洲不卡AV影片在线播放</a>| <a href="http://kt4444.com" target="_blank">国产精品麻豆免费版</a>| <a href="http://shmtweld.com" target="_blank">蜜桃视频在线观看免费网址入口</a>| <a href="http://010youhua.com" target="_blank">亚洲成人免费在线</a>| <a href="http://9527paotui.com" target="_blank">国内永久免费crm系统z在线</a>| <a href="http://720880.com" target="_blank">国产国产人免费人成成免视频</a>| <a href="http://takiku.com" target="_blank">国内成人精品亚洲日本语音</a>| <a href="http://513573.com" target="_blank">亚洲乱妇熟女爽到高潮的片 </a>| <a href="http://1ygogo.com" target="_blank">激情无码亚洲一区二区三区</a>| <a href="http://kouchoubao.com" target="_blank">亚洲区精品久久一区二区三区</a>| <a href="http://www-777730.com" target="_blank">亚洲欧洲日韩国产综合在线二区</a>| <a href="http://www-01313.com" target="_blank">中文字幕第13亚洲另类</a>| <a href="http://gbn21.com" target="_blank">亚洲一区精品伊人久久伊人</a>| <a href="http://bdgxhome.com" target="_blank">午夜亚洲国产成人不卡在线</a>| <a href="http://changfafangzhi.com" target="_blank">国产精品视频免费一区二区三区 </a>| <a href="http://8fue.com" target="_blank">亚洲国产精品专区</a>| <a href="http://vastraje.com" target="_blank">337p欧洲亚洲大胆艺术</a>| <a href="http://cebeke.com" target="_blank">在线观看亚洲人成网站</a>| <a href="http://asdfghjklzxcv.com" target="_blank">亚洲人成电影在在线观看网色</a>| <a href="http://eigakyuka.com" target="_blank">亚洲AV无码国产在丝袜线观看 </a>| <a href="http://bjbf99.com" target="_blank">91高清免费国产自产拍2021</a>| <a href="http://gwcyy.com" target="_blank">日韩精品免费视频</a>| <a href="http://dstbxg.com" target="_blank">16女性下面扒开无遮挡免费</a>| <a href="http://cqtchtwq.com" target="_blank">在线免费中文字幕</a>| <a href="http://miya77772.com" target="_blank">69天堂人成无码麻豆免费视频</a>| <a href="http://400209.com" target="_blank">亚洲免费网站在线观看</a>| <a href="http://4228970.com" target="_blank">亚色九九九全国免费视频</a>| <a href="http://91ptv.com" target="_blank">久久WWW色情成人免费观看</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>