Java List Sum sum(int[] list)

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

Description

sum

License

Apache License

Declaration

public static int sum(int[] list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static int sum(int[] list) {
        int sum = 0;
        for (int x : list)
            sum += x;/*w  ww  . j  a v a2s  . c om*/
        return sum;
    }

    public static double sum(double[] list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }

    public static double sum(double[][] list) {
        double sum = 0;
        for (double[] x : list)
            sum += sum(x);
        return sum;
    }

    public static double sum(List<Double> list) {
        double sum = 0;
        for (double x : list)
            sum += x;
        return sum;
    }
}

Related

  1. getSumOfPositiveDoubles(List scores)
  2. removeOne(List summary, int start)
  3. sum(final List list1, final List list2)
  4. sum(final List list)
  5. sum(final List list)
  6. sum(List list)
  7. sum(List a)
  8. sum(List data)
  9. sum(List scores)