title: Java ArrayList contains method doesn't work
body: <p>So when I run this program it shows that the ArrayList "test" doesn't contain the array [5,6] inside the variable "position".When I checked the output, it is  clearly in there and i see that "test" does contain that element.</p>
  
  <hr>
  
  <p>Output:</p>
  
  <blockquote>
    <p>[5, 6]
    [5, 6]
    false</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>package arraylisttest;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  
  public class ArrayListTest {
      public static void main(String[] args) {
          int[] position = { 5, 6 };
          ArrayList&lt;int[]&gt; test = new ArrayList&lt;&gt;();
  
          test.add(new int[] {50, 2});
          test.add(new int[] {0, 7});
          test.add(new int[] {5, 6});
          test.add(new int[] {2, 1});
  
          System.out.println(Arrays.toString(position));
          System.out.println(Arrays.toString(test.get(2)));
          System.out.println(test.contains(position));
      }
  }
  </code></pre>