Android Double Array Average average(double[] a)

Here you can find the source of average(double[] a)

Description

average

Declaration

public static double average(double[] a) 

Method Source Code

//package com.java2s;

public class Main {
    public static double average(double[] a) {
        double sum = 0;
        for (int i = 0; i < a.length; i++) {
            sum += a[i];/*ww w. j a  v a2 s . c  om*/
        }

        return sum / a.length;
    }
}