1. public boolean equals(int x, int y){
  2.     if(x == this.x && y == this.y){
  3.         return true;
  4.     }
  5.     else{
  6.         return false;
  7.     }
  8. }
  9.  
  10. public int hashCode() {
  11.     int hash = 1;
  12.    
  13.     hash = hash * 17 + this.x;
  14.     hash = hash * 31 + this.y;
  15.  
  16.     return hash;
  17. }