Java Array Sum sum(int[] list)

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

Description

Returns the total of all of the values in the list.

License

Open Source License

Declaration

public static int sum(int[] list) 

Method Source Code

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

Related

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