title: How to create an equals method that compares two object arrays of a class?
body: <p>I am trying to create a equals method that compares two objects. The thing is, I'm a bit a of new to this stuff so I'll try to explain my goal as easy as possible.</p>
  
  <pre><code>public class A {
  ...
  }
  
  public class B {
  private A[] arr = new A[10];
  
  public boolean equals(A[] temp) {
  //compare
  }
  }
  </code></pre>
  
  <p>Assume the code above is a summary of what I have. Now, assume I had: <code>arr.equals(Obj)</code>
  Obj being another A[] object. Now in my equals statement, I want to reference the original <code>arr</code> array, how do I go about doing that?</p>
  
  <p>For example, let's say I wanted to compare arr's length to temp's length (aka Obj's length), how would I do that? I know it would be something like (temp.length == arr.length) but how do I access arr when I pass it through by doing <code>arr.equals(obj)</code>?</p>
  
  <p>EDIT: Just to clarify, assume the objects aren't simple arrays. So for instance, class A could have a Name, a Type (Both Strings) and possibly a Quantity (an int), so I wouldn't be able to simply compare them like they're two normal arrays.</p>
  
  <p>Thanks!</p>