I have a class Abc as below

```
public class Abc {
  int[] attributes;

  Abc(int[] attributes){
    this.attributes = attributes;
  }
}

```

Overriding the `Abc` hash code as below 

```
@Override
public int hashCode() {
    int hashCode = 0;
    int multiplier = 1;
    for(int i = attributes.length-1 ; i >= 0 ; i++){
        hashCode = hashCode+(attributes[i]*multiplier);
        multiplier = multiplier*10;
    }       
    return hashCode;    
}

```

I am using above class to create a list of objects and I want to compare whether the two lists are equal i.e. lists having objects with same attributes.

```
    List<Abc> list1 ;
     list1.add(new Abc(new int[]{1,2,4}));
     list1.add(new Abc(new int[]{5,8,9}));
     list1.add(new Abc(new int[]{3,4,2}));
   List<Abc> list2;       
     list2.add(new Abc(new int[]{5,8,9}));
     list2.add(new Abc(new int[]{3,4,2}));
      list2.add(new Abc(new int[]{1,2,4}));

```

How can I compare the above two lists with/without iterating over each list . Also is there any better way to override the hashcode , so that two classes having the same attributes(values and order) should be equal.