Java Array Sum sum(int... xs)

Here you can find the source of sum(int... xs)

Description

sum

License

Open Source License

Declaration

public static int sum(int... xs) 

Method Source Code

//package com.java2s;

public class Main {
    public static int sum(int... xs) {
        int sum = 0;
        for (int x : xs)
            sum += x;//from   w  ww  .  ja v a2 s . co  m
        return sum;
    }
}

Related

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