Here you can find the source of mean(int[] values)
Parameter | Description |
---|---|
values | The array of integers |
public static int mean(int[] values)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w . jav a 2 s . co m*/ * Returns the average of the values. * * @param values The array of integers * @return The mean of the values */ public static int mean(int[] values) { int result = 0; for (int value : values) { result += value; } result /= values.length; return result; } }