Here you can find the source of sum(final Double[] doubles)
Parameter | Description |
---|---|
doubles | the array to sum. |
public static Double sum(final Double[] doubles)
//package com.java2s; //License from project: Apache License public class Main { /**//from ww w .j a v a2 s . c o m * Get the sum of an array of doubles. * @param doubles the array to sum. * @return the sum of the array */ public static Double sum(final Double[] doubles) { Double sum = 0.0; for (int j = 0; j < doubles.length; j++) { sum += doubles[j]; } return sum; } /** * Get the sum of an array of integers. * @param integers the array to sum. * @return the sum of the array */ public static Integer sum(final Integer[] integers) { Integer sum = 0; for (int j = 0; j < integers.length; j++) { sum += integers[j]; } return sum; } }