Java Collection Sum sum(Collection values)

Here you can find the source of sum(Collection values)

Description

sum

License

Open Source License

Declaration

public static int sum(Collection<Integer> values) 

Method Source Code


//package com.java2s;

import java.util.Collection;

public class Main {
    public static int sum(Collection<Integer> values) {
        int sum = 0;
        for (Integer i : values) {
            sum = sum + i;/*from  w  w  w .j ava2s .com*/
        }
        return sum;
    }
}

Related

  1. sum(Collection values)
  2. sum(Collection values)
  3. sum(Collection values)
  4. sum(Collection values)
  5. sum(Collection vec)
  6. sum(Collection collection)
  7. sum(final Collection values)
  8. sumDouble(Collection collection)
  9. summarizeCollection(Collection collection, String collectionType, String elementType)