锘??xml version="1.0" encoding="utf-8" standalone="yes"?>禁断一区二区三区在线,韩国精品免费视频,国产激情一区二区三区四区http://www.aygfsteel.com/orangle/璁ょ湡宸ヤ綔錛屽強(qiáng)鏃舵葷粨zh-cnTue, 17 Jun 2025 01:41:26 GMTTue, 17 Jun 2025 01:41:26 GMT60紼嬪簭鍛樺繀璇諱功鐩?/title><link>http://www.aygfsteel.com/orangle/archive/2012/10/30/390476.html</link><dc:creator>orangle_lzz</dc:creator><author>orangle_lzz</author><pubDate>Tue, 30 Oct 2012 09:27:00 GMT</pubDate><guid>http://www.aygfsteel.com/orangle/archive/2012/10/30/390476.html</guid><wfw:comment>http://www.aygfsteel.com/orangle/comments/390476.html</wfw:comment><comments>http://www.aygfsteel.com/orangle/archive/2012/10/30/390476.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/orangle/comments/commentRss/390476.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/orangle/services/trackbacks/390476.html</trackback:ping><description><![CDATA[     鎽樿: 鏈堝厜鍗氬6鏈?2鏃ュ彂琛ㄤ簡(jiǎn)銆婂啓緇欐柊鎵嬬▼搴忓憳鐨勪竴灝佷俊銆嬶紝緲昏瘧鑷夾n open letter to those who want to start programming銆嬶紝鎴戠殑鏈嬪弸錛堜粬鍦ㄦ湰绔欑殑id鏄疢ailper錛夊憡璇夋垜錛屼粬甯屾湜鍦ㄩ叿澹充笂鐪嬪埌涓綃囨洿鍏鋒搷浣滄х殑鏂囩珷銆傚洜涓轟粬涔熸槸鍠滄緙栫▼鍜屾妧鏈殑瀹朵紮錛屼簬鏄紝鎴戣浠栨妸浠栫殑涓浜涘涔?fàn)Python鍜學(xué)eb緙栫▼鐨勪竴浜涚偣婊存葷粨涓涓嬨備簬鏄粬緇欐垜鍙戞潵浜?jiǎn)涓浜涗粬鐨勫績(jī)寰楀拰緇忓巻錛屾垜...  <a href='http://www.aygfsteel.com/orangle/archive/2012/10/30/390476.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/orangle/aggbug/390476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/orangle/" target="_blank">orangle_lzz</a> 2012-10-30 17:27 <a href="http://www.aygfsteel.com/orangle/archive/2012/10/30/390476.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Dom4j浣跨敤鍏ラ棬鈥攛ml鐨勮В鏋?/title><link>http://www.aygfsteel.com/orangle/archive/2012/10/18/389837.html</link><dc:creator>orangle_lzz</dc:creator><author>orangle_lzz</author><pubDate>Thu, 18 Oct 2012 10:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/orangle/archive/2012/10/18/389837.html</guid><wfw:comment>http://www.aygfsteel.com/orangle/comments/389837.html</wfw:comment><comments>http://www.aygfsteel.com/orangle/archive/2012/10/18/389837.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/orangle/comments/commentRss/389837.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/orangle/services/trackbacks/389837.html</trackback:ping><description><![CDATA[     鎽樿: 杞澆錛歨ttp://www.ibm.com/developerworks/cn/xml/x-dom4j.html  dom4j API 鍖呭惈涓涓В鏋?XML 鏂囨。鐨勫伐鍏楓傛湰鏂囦腑灝嗕嬌鐢ㄨ繖涓В鏋愬櫒鍒涘緩涓涓ず渚?XML 鏂囨。銆傛竻鍗?1 鏄劇ず浜?jiǎn)杩欎釜绀轰?XML 鏂囨。錛宑atalog.xml銆?娓呭崟 1. 紺轟緥 XML 鏂囨。錛坈atalog.xml錛? Code highlight...  <a href='http://www.aygfsteel.com/orangle/archive/2012/10/18/389837.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/orangle/aggbug/389837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/orangle/" target="_blank">orangle_lzz</a> 2012-10-18 18:25 <a href="http://www.aygfsteel.com/orangle/archive/2012/10/18/389837.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java涓殑hashcode錛堬級(jí) 鍑芥暟 http://www.aygfsteel.com/orangle/archive/2012/09/11/387486.htmlorangle_lzzorangle_lzzTue, 11 Sep 2012 09:31:00 GMThttp://www.aygfsteel.com/orangle/archive/2012/09/11/387486.htmlhttp://www.aygfsteel.com/orangle/comments/387486.htmlhttp://www.aygfsteel.com/orangle/archive/2012/09/11/387486.html#Feedback0http://www.aygfsteel.com/orangle/comments/commentRss/387486.htmlhttp://www.aygfsteel.com/orangle/services/trackbacks/387486.html
  1 import java.util.Collection;
  2 import java.util.HashSet;
  3 /**
  4  * 涓轟粈涔堣鏈?=錛宧ashcode錛宔quels鍛?br />  5  * hashcode鍙互鎬庝箞鐢?br />  6  * 浣跨敤鏃跺欏鏄撳拷瑙嗙殑灝忛棶棰?br />  7  * @author lzz
  8  */
  9 public class HashCodeTest {
 10     public static void main(String[] args) {
 11         System.out.println("Test-------1---------");
 12         StringTest(); 
 13         //閲嶅啓hashcode鐨勪竴涓渚嬶紝鏈夊彲鑳戒細(xì)鏈夎繖縐嶉渶姹?/span>
 14         System.out.println("Test-------2--------");
 15         CollTest();
 16         System.out.println("Test-------3---------");
 17         CollTest1();
 18         //浣跨敤hashcode鏃跺欐敞鎰忎簨欏癸紝涓涓皬妗堜緥錛屽彲鑳介犳垚鍐呭瓨婧㈠嚭
 19         //褰撶劧浣跨敤hashcode鍙互鎻愰珮鏌ヨ鏁堢巼錛岃繖涔熷氨鏄痵et涓轟粈涔堢敤hash綆楁硶鐨勫師鍥犲惂
 20         System.out.println("Test-------4---------");
 21         CollTest2();
 22     }
 23     
 24     public static void StringTest(){    
 25         
 26     /* 榪欐槸Object涓殑equels
 27      *  public boolean equals(Object obj) {
 28                 return (this == obj);
 29          }*/
 30         String c=new String("a");
 31         String d=new String("a");
 32         System.out.println(c.hashCode()==d.hashCode());
 33         System.out.println(c==d);
 34         System.out.println(c.equals(d));
 35     //寮曠敤api涓殑瑙i噴灝辨槸
 36     //濡傛灉鏍規(guī)嵁 equals(Object) 鏂規(guī)硶錛屼袱涓璞℃槸鐩哥瓑鐨勶紝閭d箞瀵硅繖涓や釜瀵硅薄涓殑姣忎釜瀵硅薄璋冪敤 hashCode 鏂規(guī)硶閮藉繀欏葷敓鎴愮浉鍚岀殑鏁存暟緇撴灉
 37     //鎵浠pi寤鴻閲嶅啓equals鍚屾椂涔熻閲嶅啓hashcode鏂規(guī)硶    
 38     }
 39     
 40     /**
 41      * 娌℃湁閲嶅啓hashcode鏂規(guī)硶鐨勭被鍦ㄥ姞鍏ashSet鐨勬儏鍐?br /> 42      */
 43     public static void CollTest(){
 44         Collection coll=new HashSet();
 45         CollectionTest coll1=new CollectionTest(3, 4);
 46         CollectionTest coll2=new CollectionTest(3, 5);
 47         CollectionTest coll3=new CollectionTest(3, 4);
 48         coll.add(coll1);
 49         coll.add(coll2);
 50         coll.add(coll3);
 51         System.out.println(coll.size());
 52         
 53     }
 54     
 55     /**
 56      * 閲嶅啓hashcode鏂規(guī)硶鐨勭被鍦ㄥ姞鍏ashSet鐨勬儏鍐?br /> 57      */
 58     public static void CollTest1(){
 59         Collection coll=new HashSet();
 60         CollectionTest1 coll1=new CollectionTest1(3, 4);
 61         CollectionTest1 coll2=new CollectionTest1(3, 5);
 62         CollectionTest1 coll3=new CollectionTest1(3, 4);
 63         coll.add(coll1);
 64         coll.add(coll2);
 65         coll.add(coll3);
 66         System.out.println(coll.size());
 67         
 68     }
 69     
 70     /**
 71      * 濡傛灉榪欐牱浣跨敤浼?xì)閫犳垚鍐呭瓨婧㈠嚭闂
 72      */
 73     public static void CollTest2(){
 74         Collection coll=new HashSet();
 75         CollectionTest1 coll1=new CollectionTest1(3, 4);
 76         CollectionTest1 coll2=new CollectionTest1(3, 5);
 77         System.out.println(coll2.hashCode());
 78         coll.add(coll1);
 79         coll.add(coll2);
 80         coll2.x=4;
 81         System.out.println(coll2.hashCode());
 82         /*褰揷oll2鐨刪ashcode鐢熸垚浠ュ悗鍔犲叆鍒癱oll涓悗錛屾垜浠敼鍙樹粠鏉oll2鐨勫睘鎬э紝姝ゆ椂瀹冪殑hash宸茬粡鍙樺寲浜?jiǎn)锛?br /> 83         鎵浠ュ綋鎴戜滑鍐嶅幓鍒犻櫎瀹冪殑鏃跺欙紝coll涓瓨鍌ㄧ殑coll2鐨刪ashcod宸茬粡涓嶆槸鍘熸潵鐨勪簡(jiǎn)
 84         鎵浠ユ渶寮濮嬬殑閭d釜coll2 灝辨病娉曡鍥炴敹錛?nbsp; 濡傛灉榪欐牱鐨勭▼搴忓ぇ閲忓嚭鐜板湪浠g爜涓紝閭d箞鍐呭瓨鏃╂櫄浼?xì)鐖嗘帀鐨?/span>*/
 85         
 86         coll.remove(coll2);
 87         System.out.println(coll.size());
 88         
 89     }
 90 }
 91 /**
 92  * 涓嶉噸鏂板啓hashcode鍜宔quels
 93  * @author lzz
 94  */
 95 class CollectionTest{
 96     int x;
 97     int y;
 98     public CollectionTest(int x,int y){
 99         this.x=x;
100         this.y=y;
101     }
102 }
103 
104 /**
105  * 閲嶆柊鍐檋ashcode鍜宔quels
106  * @author lzz
107  */
108 class CollectionTest1{
109     int x;
110     int y;
111     public CollectionTest1(int x,int y){
112         this.x=x;
113         this.y=y;
114     }
115     @Override
116     public int hashCode() {
117         final int prime = 31;
118         int result = 1;
119         result = prime * result + x;
120         result = prime * result + y;
121         return result;
122     }
123     @Override
124     public boolean equals(Object obj) {
125         if (this == obj)
126             return true;
127         if (obj == null)
128             return false;
129         if (getClass() != obj.getClass())
130             return false;
131         CollectionTest1 other = (CollectionTest1) obj;
132         if (x != other.x)
133             return false;
134         if (y != other.y)
135             return false;
136         return true;
137     }
138     
139 }
140 


orangle_lzz 2012-09-11 17:31 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 广安市| 昭觉县| 元谋县| 嵊泗县| 元氏县| 工布江达县| 白河县| 绥中县| 陆河县| 五家渠市| 朝阳市| 土默特左旗| 宜昌市| 冷水江市| 溆浦县| 东港市| 盱眙县| 台南县| 瓮安县| 毕节市| 兴安县| 苍南县| 定西市| 中牟县| 营口市| 黄平县| 周宁县| 格尔木市| 汕尾市| 叶城县| 西乡县| 聊城市| 乌鲁木齐县| 苍山县| 黄浦区| 赫章县| 仲巴县| 仁化县| 广汉市| 甘肃省| 安塞县|