title: convert 2D ArrayList<Double> to 2D array of double
body: <p>How I can convert a 2D <code>ArrayList</code> of double to a 2D array double ? 
  I create a <code>ArrayList&lt;ArrayList&lt;Double&gt;&gt;</code> and I want to convert into a <code>double [][]</code> </p>
  
  <p>I try this but the last line doesn't work and I don't know why?</p>
  
  <pre><code>double data[][] = new double [datalist.size()][];
  
      for (int i = 0; i &lt; datalist.size(); i++) {
          ArrayList&lt;Double&gt; row = datalist.get(i);
          data[i] = row.toArray(new double[row.size()]);
      }
  </code></pre>
  
  <p>datalist is my 2D ArrayList , and I have an error with <code>toArray()</code>
  can you explain me why ?</p>