Here you can find the source of sum(int[] intArray)
public static double sum(int[] intArray)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static double sum(int[] intArray) { double[] doubleArray = Arrays.stream(intArray).asDoubleStream().toArray(); return sum(doubleArray); }//from w w w .ja va2 s .co m public static double sum(double[] doubleArray) { // Sum the elements in a double array double arraySum = 0; for (double d : doubleArray) { arraySum += d; } return arraySum; } }