Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean equals(Object o){ // Take care of exception if array size is < 0
- if(o == null && array == null){ // Not sure what to do with this
- return true;
- }
- if(!(o == null && array != null))
- return false;
- if(o instanceof Array12){
- return false;
- }
- Array12 array1 = (Array12<E>) o; // Fix this casting
- if(!(this.size() == array1.size())){
- return false;
- }
- for(int i=0; i < this.size;i++){
- if(!array[i].equals(array1[i])){
- return false;
- }
- }
- return true;
- }
Add Comment
Please, Sign In to add comment