title: Java two dimensional array notation and default access
body: <p>From the following code:</p>
  
  <pre><code>   /** Array for internal storage of elements.
     @serial internal array storage.
     */
     private double[][] A;
  
     /** Row and column dimensions.
     @serial row dimension.
     @serial column dimension.
     */
     private int m, n;
  
  public Matrix times (Matrix B) {
        if (B.m != n) {
           throw new IllegalArgumentException("Matrix inner dimensions must agree.");
        }
        Matrix X = new Matrix(m,B.n);
        double[][] C = X.getArray();
        double[] Bcolj = new double[n];
        for (int j = 0; j &lt; B.n; j++) {
           for (int k = 0; k &lt; n; k++) {
              Bcolj[k] = B.A[k][j];
           }
           for (int i = 0; i &lt; m; i++) {
              double[] Arowi = A[i];
              double s = 0;
              for (int k = 0; k &lt; n; k++) {
                 s += Arowi[k]*Bcolj[k];
              }
              C[i][j] = s;
           }
        }
        return X;
     }
  </code></pre>
  
  <p><code>double[] Arowi = A[i];</code></p>
  
  <p>What is this line doing?
  A is a two dimensional Matrix, why is A[i] allowed? and what exactly is it doing?
  Is that the same thing as <code>A[i][0]</code>?</p>
  
  <p>This notation is confusing.</p>
  
  <p>Also could someone translate that line to .NET, how would you do that with a <code>double[,] Matrix</code>?</p>
  
  <p>I know there is a Matrix.GetLength() which gives you a specified length of a dimension.
  But comparison to that line of Java code, how would that be translated?</p>
  
  <p><strong>EDIT</strong>
  I believe I fixed it by just replacing that line and passing in my matrix to copy the first row into a new one dimensional matrix and returning it</p>
  
  <pre><code> public double[] ConvertFirstRowOfMultiArrayToOneArray(double[,] p)
          {
              double[] array = new double[p.Length];
              for (int i = 0; i &lt; p.GetLength(0); i++)
              {
                  array[i] = p[0, i];
              }
  
              return array;
          }
  </code></pre>