×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Vasilii Vasilev
Added: May 2, 2014 2:02 PM
Views: 14
Tags: list summ
  1. ArrayList<Double> list = new ArrayList<Double>();
  2.         list.add(10.14);
  3.         list.add(20.22);
  4.         list.add(30.78);
  5.         list.add(40.46);
  6.  
  7.         double sum = 0.0;
  8.         for (double itr : list) {
  9.             sum += itr;
  10.         }
  11.         System.out.println(sum);