Java List Sum sum(List listOfNumbers)

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

Description

sum

License

Apache License

Declaration

public static <T extends Number> double sum(List<T> listOfNumbers) 

Method Source Code

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

import java.util.List;

public class Main {
    public static <T extends Number> double sum(List<T> listOfNumbers) {
        double sum = 0;
        for (T number : listOfNumbers) {
            sum += number.doubleValue();
        }/*from  w w w .  java2  s .co m*/
        return sum;
    }
}

Related

  1. sum(List l)
  2. sum(List list)
  3. sum(List lst)
  4. sum(List numbers)
  5. sum(List numbers)
  6. sum_ints(List list)
  7. sumAll(List list)
  8. sumAllColumnsOfMatrix(List> matrix)
  9. sumCreditList(List list)