Here you can find the source of average(double... args)
public static double average(double... args)
//package com.java2s; //License from project: LGPL public class Main { public static double average(double... args) { double total = 0D; for (double value : args) { total += value;//w w w. j ava 2 s .c o m } return total / args.length; } }