title: Sum all the elements java arraylist
body: <p>If I had: <code>ArrayList&lt;Double&gt; m = new ArrayList&lt;Double&gt;();</code>
  with the double values ​​inside, how should I do to add up all the ArrayList elements?</p>
  
  <pre><code>public double incassoMargherita()
  {
   double sum = 0;
   for(int i = 0; i &lt; m.size(); i++)
   {          
   }
   return sum;
  }
  </code></pre>
  
  <p>as?</p>