Java Array Sum sum(int[] a)

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

Description

sum

License

Apache License

Return

The sum of the array a.

Declaration

public final static int sum(int[] a) 

Method Source Code

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

Related

  1. sum(float[] items, int offset, int length)
  2. sum(float[] vector)
  3. sum(int... values)
  4. sum(int... xs)
  5. sum(int[] a)
  6. sum(int[] a)
  7. sum(int[] a)
  8. sum(int[] add)
  9. sum(int[] arr)