title: Finding the sum of all elements in a 2D array
body: <p>Trying to create a 2D array that will find the sum of all elements. I am not inputting my numbers into the 2D array since I am using a driver to check my work. So far I have this - however it will not complie. What am I doing wrong? </p>
  
  <pre><code>public static double sum2d (double[ ][ ] array2d)  
  {
      int sum = 0;
      for (int row=0; row &lt; array2d.length; row++)
      {
          for (int col=0; col &lt; array2d[row].length; col++)
          {
              sum = sum + array2d [row][col];
          }
      }
  
      return sum;
  }
  </code></pre>