get Long List Sum - Android java.util

Android examples for java.util:List Algorithm

Description

get Long List Sum

Demo Code


//package com.java2s;
import java.util.Collection;

public class Main {

    public static Long getLongListSum(Collection<Long> c) {
        Long sum = 0l;/*  ww  w  .j  a va  2s  . c o m*/
        for (Long i : c) {
            sum += i;
        }
        return sum;
    }
}

Related Tutorials