package class9_1_HashSet_inClass_start; public class Rock { private int x; private int y; public Rock(int x, int y) { this.x = x; this.y = y; } @Override public boolean equals(Object obj) { Rock other = (Rock)obj; return other.x == this.x && other.y == this.y; } @Override public int hashCode() { double d = 5; String s = "Bob"; return x+127*y +Double.hashCode(d) +s.hashCode(); } }