Java List Sum sum(List list)

Here you can find the source of sum(List list)

Description

sum

License

Apache License

Parameter

Parameter Description
list a parameter

Return

Integer

Declaration

public static Integer sum(List<Integer> list) 

Method Source Code

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

import java.util.List;

public class Main {
    /**/*ww w .ja v a  2s .c  o m*/
     * @param list
     * @return Integer
     */
    public static Integer sum(List<Integer> list) {
        Integer result = 0;
        for (Integer it : list) {
            result += it;
        }
        return result;
    }
}

Related

  1. sum(List a)
  2. sum(List data)
  3. sum(List scores)
  4. sum(List vals)
  5. sum(List l)
  6. sum(List lst)
  7. sum(List numbers)
  8. sum(List numbers)
  9. sum(List listOfNumbers)