Here you can find the source of sum(double[] t)
static public double sum(double[] t)
//package com.java2s; //License from project: Open Source License public class Main { static public double sum(double[] t) { if (t == null) { System.err.println("empty array sum"); return 0; } else {/*from w w w .j ava2s . c o m*/ double sum = 0; for (int i = 0; i < t.length; i++) { sum = sum + t[i]; } return sum; } } }