title: Comparing 2D arrays
body: <p>Im trying to compare two 2D arrays by using this. But I keep getting "<strong>Arrays are not the same.</strong>" even when they are the same. </p>
  
  <pre><code>     int i;
       int j = 0;
       int k;
       int l;
  
  List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
  List&lt;Integer&gt; list1 = new ArrayList&lt;Integer&gt;();
  List&lt;Integer&gt; zero = new ArrayList&lt;Integer&gt;();
  
   for ( i = 1; i &lt;= 16; i++) {
      list.add(i);
  
  
  }
  
  //System.out.println(list); //[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  Collections.shuffle(list.subList(1, 15));
  System.out.println(list);
  
  Collections.replaceAll(list, 16, 0);
     System.out.println(list);
  
  
  // System.out.println(list); //[11, 5, 10, 9, 7, 0, 6, 1, 3, 14, 2, 4, 15, 13, 12, 8]
  
  int[][] a2 = new int[4][4];
  int [][] a3 = new int[4][4];
  for ( i = 0; i &lt; 4; i++) {
      for ( j = 0;  j&lt; 4; j++) {
  
  
          a2[i][j] = list.get(i*4 + j);
          a3[i][j] = list.get(i*4 + j);
      }
  
  }
  for (int[] row : a2) {
  System.out.print("[");
  for (   int a : row)
      System.out.printf("%4d", a);
  System.out.println("]");
  }
  for (int[] row : a3) {
  System.out.print("[");
  for (   int a : row)
      System.out.printf("%4d", a);
  System.out.println("]");
  }
   boolean check1 = Arrays.equals(a2, a3);
  if(check1 == false)
  System.out.println("Arrays are not same.");
  else
  System.out.println("Both Arrays are same.");
  </code></pre>
  
  <p>I can't do it like this either. 
       boolean check1 = Arrays.equals(a2[i][j], a3[i][j]);</p>