Java List Sum sumAll(List list)

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

Description

sum All

License

Open Source License

Declaration

public static long sumAll(List<? extends Number> list) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    public static long sumAll(List<? extends Number> list) {
        long sum = 0L;
        for (Number item : list) {
            sum = sum + item.longValue();
        }// w  ww.  j a  va 2  s.  c o m
        return sum;
    }
}

Related

  1. sum(List lst)
  2. sum(List numbers)
  3. sum(List numbers)
  4. sum(List listOfNumbers)
  5. sum_ints(List list)
  6. sumAllColumnsOfMatrix(List> matrix)
  7. sumCreditList(List list)
  8. sumDifferences(List a, List b)
  9. sumDouble(List list)