How do I convert a java ArrayList<Double> to the equivalent double[]
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6018267/how-to-cast-from-listdouble-to-double-in-java">How to cast from List&lt;Double&gt; to double[] in Java?</a>  </p>
</blockquote>



<p>So far the only method I can get working is to loop through the entire array. I was hoping for something along the lines of:</p>

<pre><code>ArrayList&lt;Double&gt; myArrayList = ... // initiaize
double[] myArray = ... // magic line here
</code></pre>
