Java Array Sum sum(int[] ints)

Here you can find the source of sum(int[] ints)

Description

sum

License

LGPL

Declaration

public static int sum(int[] ints) 

Method Source Code

//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;
    }
}

Related

  1. sum(int[] array)
  2. sum(int[] array)
  3. sum(int[] array)
  4. sum(int[] array)
  5. sum(int[] intArray)
  6. sum(int[] list)
  7. sum(int[] numbers)
  8. sum(int[] source)
  9. sum(int[] values)