Here you can find the source of sum(Collection
Parameter | Description |
---|---|
values | a parameter |
public static double sum(Collection<Double> values)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from w ww . j av a 2 s. co m*/ * @param values * @return */ public static double sum(Collection<Double> values) { double ret = 0; for (Double d : values) ret += d; return ret; } }