I need a hash function to overide the hashCode() method from the object class.
I have a Point class that represents a point on coordinate grid. The instance variables are double x, y;
I also have methods
public int getX(){
return Math.round(x);
}
public int getY(){
Math.round(y);
}
How can I create a hash function that will return an integer? Would a simply put
return Math.round(getX()/getY());
work?