Here you can find the source of computeMean(List extends Number> fs)
public static double computeMean(List<? extends Number> fs)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static double computeMean(List<? extends Number> fs) { Double sum = 0.0;/* ww w.j a v a 2 s .c om*/ for (Number d : fs) sum += d.doubleValue(); return sum / fs.size(); } /** * This method computes the average of a list of doubles. * @param ds the list of numbers * @return the average of ds */ public static double computeMean(double[] ds) { double d = 0; for (double n : ds) d += n; return d / ds.length; } /** * This method computes the average of a list of ints. * @param ds the list of numbers * @return the average of ds */ public static double computeMean(int[] ds) { double d = 0; for (int n : ds) d += n; return d / ds.length; } }