title: Adding values from an arraylist of an arraylist
body: <p>Does anyone know how I can sum the values in an arraylist contained inside an arraylist?
  For e.g.</p>
  
  <pre><code>   ArrayList&lt;Double&gt; arr1=new ArrayList&lt;Double&gt;;
    ArrayList&lt;Double&gt; arr2=new ArrayList&lt;Double&gt;;
  </code></pre>
  
  <p>Let say:                                                                               arr1=[4.5,6.7,8.9,7.3,4.5] 
    arr2=[5.6,7.8,1.3,4.5,3.2]</p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;Double&gt;&gt; arrayListOfarr1_arr2=new ArrayList&lt;ArrayList&lt;Double&gt;&gt;();
  
   arrayListOfarr1_arr2.add(arr1);
   arrayListOfarr1_arr2.add(arr2);
  </code></pre>
  
  <p>How can I it such that  both of the arrayList values can be added together when it points to the same index inside the arrayList the contains them?
  For e.g.
  sum_of_arr1_arr2=[10.1,14.5,10.2,11.8,7.7]</p>