Hi,
I have this simple class
public class Position{
int x;
int y;
Position(int x,int y){...}
public int hashCode(){
Integer ix = this.x;
Integer iy = this.y;
return 13*iy.hashCode() + 43*ix.hashCode();
}
}
Im storing instances in a hashMap
, but then cant retrieve them. I fear its the hashcode
implementation. Is there any way to implement it when x and y are not Objects?
Thanks in advance