Here you can find the source of sum(int[] array)
public static int sum(int[] array)
//package com.java2s; //License from project: Apache License public class Main { public static int sum(int[] array) { int sum = 0; for (int e : array) { sum += e;/*from ww w . java 2 s .c o m*/ } return sum; } public static long sum(long[] array) { long sum = 0; for (long e : array) { sum += e; } return sum; } }