Advertisement
Guest User

Untitled

a guest
Mar 7th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement