Android Array Average getArrayAvg(int... i)

Here you can find the source of getArrayAvg(int... i)

Description

get Array Avg

Declaration

public static int getArrayAvg(int... i) 

Method Source Code

//package com.java2s;

public class Main {

    public static int getArrayAvg(int... i) {
        return getArraySum(i) / i.length;
    }/*from   ww  w.  jav a2s.c  o  m*/

    public static int getArraySum(int... i) {
        int sum = 0;
        for (int j = 0; j < i.length; j++) {
            sum += i[j];
        }
        return sum;
    }
}

Related

  1. average(double[] pixels)
  2. average(int[] pixels)