Comparing Object Values Using 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 hc1 = file1.hashCode();
    System.out.println(hc1);
    int hc2 = file2.hashCode();
    System.out.println(hc2);
    int hc3 = file3.hashCode();
    System.out.println(hc3);
  }
}








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.