This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 7th, 2013  |  syntax: Java  |  size: 0.24 KB  |  views: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data