Here you can find the source of average(List
Parameter | Description |
---|---|
numbers | - doubles |
public static double average(List<Double> numbers)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**//from ww w .j av a 2 s. co m * * @param numbers - doubles * @return their average */ public static double average(List<Double> numbers) { double sum = 0; for (Double number : numbers) sum += number; return sum / numbers.size(); } }