Android examples for java.lang:array calculation
get Array Average
//package com.java2s; public class Main { public static int getArrayAvg(int... i) { return getArraySum(i) / i.length; }//from w ww. j a v 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; } }