Android examples for java.lang:long
Calculate total value for long array
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; } }