不同的实例对象的hashCode是不相同的
package com.cici.test;
class DoubleLinkNode{
public int iData;
public double dData;
public DoubleLinkNode next;
public DoubleLinkNode pre;
public DoubleLinkNode (int id,double dd){
iData = id;
dData = dd;
}
public void displayLink(){
System.out.println("iData "+iData);
}
}
public class DoubleLinkList {
public static void main(String[] args) {
DoubleLinkNode d1 = new DoubleLinkNode(10,10.1);
DoubleLinkNode d2 = new DoubleLinkNode(20,20.1);
DoubleLinkNode d3 = new DoubleLinkNode(30,30.1);
DoubleLinkNode d4 = new DoubleLinkNode(10,10.1);
System.out.println(d1.hashCode());
System.out.println(d1.hashCode());
System.out.println(d2.hashCode());
System.out.println(d3.hashCode());
System.out.println(d4.hashCode());
}
}
27134973
27134973
1284693
31168322
17225372