Calculate total value for long array - Android java.lang

Android examples for java.lang:long

Description

Calculate total value for long array

Demo Code

import java.lang.reflect.Array;

public class Main{

    public static long total(long[] array) {
        long total = 0;
        for (long value : array) {
            total += value;/*from ww w.  j  av a2  s . com*/
        }
        return total;
    }

}

Related Tutorials