Here you can find the source of getSum(List
Parameter | Description |
---|---|
values | the values. |
public static Double getSum(List<Double> values)
//package com.java2s; import java.util.List; public class Main { /**//from www.j a v a 2 s . com * Returns the sum of the given values. * * @param values the values. * @return the sum. */ public static Double getSum(List<Double> values) { Double sum = 0.0; for (Double value : values) { if (value != null) { sum += value; } } return sum; } }