Java ArrayList Average getAverage(ArrayList values)

Here you can find the source of getAverage(ArrayList values)

Description

get Average

License

Open Source License

Declaration

static public double getAverage(ArrayList<Double> values) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    static public double getAverage(ArrayList<Double> values) {
        double sum = 0;

        for (double value : values) {
            sum += value;/*from  w ww  .  j a v  a  2 s .com*/
        }
        return sum / values.size();
    }
}

Related

  1. average(ArrayList nums)
  2. average(ArrayList array)
  3. averageInColumns(ArrayList lines)
  4. getAverage(ArrayList data)
  5. getAverageOfList(ArrayList values)