title: Java Arrays.equals() returns false for two dimensional arrays
body: <p>I was just curious to know - why does Arrays.equals(double[][], double[][]) return false? when in fact the arrays have the same number of elements and each element is the same?</p>
  
  <p>For example I performed the following test. </p>
  
  <pre><code>double[][] a,  b;
  int size =5;
  
  a=new double[size][size];
  b=new double[size][size];
  
  for( int i = 0; i &lt; size; i++ )
      for( int j = 0; j &lt; size; j++ ) {
          a[i][j]=1.0;
          b[i][j]=1.0;
      }
  
  if(Arrays.equals(a, b))
      System.out.println("Equal");
  else
      System.out.println("Not-equal");
  </code></pre>
  
  <p>Returns false and prints "Not-equal".</p>
  
  <p>on the other hand, if I have something like this:</p>
  
  <pre><code>double[] a,  b;
  int size =5;
  
  a=new double[size];
  b=new double[size];
  
  for( int i = 0; i &lt; size; i++ ){
      a[i]=1.0;
      b[i]=1.0;
  } 
  
  if(Arrays.equals(a, b))
      System.out.println("Equal");
  else
      System.out.println("Not-equal");
  </code></pre>
  
  <p>returns true and prints "Equal". Does the method only work with single dimensions? if so, is there something similar for multi-dimensional arrays in Java?</p>