Here you can find the source of sum(double[] array)
public static double sum(double[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static double sum(double[] array) { return sum(array, array.length); }/*from w ww. ja v a 2 s. co m*/ public static double sum(double[] array, int len) { assert len > 0; assert len <= array.length; double s = 0; for (int i = 0; i < len; ++i) { s += array[i]; } return s; } public static double sum(int[] array) { double s = 0; for (int i = 0; i < array.length; ++i) { s += array[i]; } return s; } }