Here you can find the source of average(int... values)
public static int average(int... values)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww . jav a 2 s.com * Gets the rounded average of all the integer values given */ public static int average(int... values) { int total = 0; for (int v : values) total += v; return Math.round((float) total / (float) values.length); } }