Here you can find the source of sum(int[] a)
public final static int sum(int[] a)
//package com.java2s; //License from project: Apache License public class Main { /** @return The sum of the array a. */ public final static int sum(int[] a) { int Result = 0; for (int i = 0; i < a.length; i++) Result += a[i];//w w w.ja va 2 s. c om return Result; } }