Here you can find the source of mean(List
public static float mean(List<Float> values)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static float mean(List<Float> values) { float mean = 0; for (float value : values) { mean += value;/*from w ww .j a v a2s .co m*/ } mean = mean / (float) values.size(); return mean; } public static float mean(float[] values) { float mean = 0; for (float value : values) { mean += value; } mean = mean / (float) values.length; return mean; } }