Here you can find the source of sum(int[] list)
public static int sum(int[] list)
//package com.java2s; public class Main { /**// ww w . j av a 2 s . c o m * Returns the total of all of the values in the list. */ public static int sum(int[] list) { int total = 0, lsize = list.length; for (int ii = 0; ii < lsize; ii++) { total += list[ii]; } return total; } }