daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public boolean equals(Object f) {
  2.     if(!f.instanceof(FIFO)) {
  3.         throw new ClassCastException("Wrong class type");
  4.     }
  5.    
  6.     if(this.size() != f.size())
  7.         return false;
  8.    
  9.     for(int i=0; i<f.size(); i++) {
  10.         if(this.get(i) == null && f.get(i) != null)
  11.             return false;
  12.         if(!this.get(i).equals(f.get(i)))
  13.             return false;
  14.     }
  15.    
  16.     return true;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top