Here you can find the source of mean(double[] list)
public static double mean(double[] list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static double mean(double[] list) { return sum(list) / list.length; }//from w w w . j a v a 2s . com public static int sum(int[] list) { int sum = 0; for (int x : list) sum += x; return sum; } public static double sum(double[] list) { double sum = 0; for (double x : list) sum += x; return sum; } public static double sum(double[][] list) { double sum = 0; for (double[] x : list) sum += sum(x); return sum; } public static double sum(List<Double> list) { double sum = 0; for (double x : list) sum += x; return sum; } }