array Sum - Android java.lang

Android examples for java.lang:array calculation

Description

array Sum

Demo Code


//package com.java2s;

public class Main {
    public static final float arraySum(final float[] pValues) {
        float sum = 0;
        final int valueCount = pValues.length;
        for (int i = 0; i < valueCount; i++) {
            sum += pValues[i];/*from w ww .j a v a  2  s . c  o  m*/
        }
        return sum;
    }
}

Related Tutorials