Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1.    public boolean equals(Object o){ // Take care of exception if array size is < 0
  2.  
  3.         if(o == null && array == null){   // Not sure what to do with this
  4.             return true;
  5.         }
  6.         if(!(o == null && array != null))
  7.             return false;
  8.        
  9.         if(o instanceof Array12){    
  10.             return false;
  11.         }
  12.         Array12 array1 = (Array12<E>) o;  // Fix this casting
  13.             if(!(this.size() == array1.size())){
  14.                 return false;
  15.             }
  16.             for(int i=0; i < this.size;i++){
  17.                 if(!array[i].equals(array1[i])){
  18.                     return false;
  19.                 }
  20.             }
  21.             return true;
  22.        
  23.    }
Add Comment
Please, Sign In to add comment