Get the identity hash codes : hashCode « Class Definition « Java Tutorial






import java.io.File;

public class Main {
  public static void main(String[] argv) throws Exception {
    File file1 = new File("a");
    File file2 = new File("a");
    File file3 = new File("b");

    int ihc1 = System.identityHashCode(file1);
    System.out.println(ihc1);
    int ihc2 = System.identityHashCode(file2);
    System.out.println(ihc2);
    int ihc3 = System.identityHashCode(file3);
    System.out.println(ihc3);

  }
}








5.34.hashCode
5.34.1.Implement hashCode using commons-lang
5.34.2.Comparing Object Values Using Hash Codes
5.34.3.Get the identity hash codes
5.34.4.Null Safe Hash Code
5.34.5.Secure Hash
5.34.6.Get hash code for primitive data types
5.34.7.A very efficient java hash algorithm, based on the BuzHash algoritm
5.34.8.Computing hash codes
5.34.9.Returns an integer hash code representing the given double array value.