Here you can find the source of sum(int[] ints)
public static int sum(int[] ints)
//package com.java2s; /*//from ww w . ja v a2 s . com * MoXie (SysTem128@GMail.Com) 2009-7-27 11:04:53 * * Copyright © 2008-2009 Zoeey.Org * Code license: GNU Lesser General Public License Version 3 * http://www.gnu.org/licenses/lgpl-3.0.txt */ public class Main { public static int sum(int[] ints) { int sum = 0; if (ints != null) { for (int i = 0; i < ints.length; i++) { sum += ints[i]; } } return sum; } }