I was learning hashcode in more depth and figured that:
1. If you override equals(), you must override hashcode() too.
2. To find if
Most is already answered, so here's just another enlightening example:
String s1 = "foo";
String s2 = "foo";
System.out.println(s1 == s2); // true, because same reference (string pool)
String s3 = new String("foo");
String s4 = new String("foo");
System.out.println(s3 == s4); // false, because different reference
System.out.println(s3.equals(s4)); // true, because same value