Here you can find the source of mean(int... values)
public static double mean(int... values)
//package com.java2s; public class Main { public static double mean(int... values) { return sum(values) / values.length; }//www . j a va 2s . c o m public static float mean(long... values) { return sum(values) / values.length; } public static double mean(double... values) { return sum(values) / values.length; } public static int sum(int... values) { int sum = 0; for (int i = 0; i < values.length; i++) { sum += values[i]; } return sum; } public static long sum(long... values) { long sum = 0L; for (int i = 0; i < values.length; i++) { sum += values[i]; } return sum; } public static double sum(double... values) { double sum = 0.0; for (int i = 0; i < values.length; i++) { sum += values[i]; } return sum; } }