Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

import java.util.concurrent.ExecutionException;

import java.util.concurrent.Future;

public class Main {

    public static <T extends Number> Long sum(List<Future<T>> list)
            throws InterruptedException, ExecutionException {
        long sum = 0;
        for (Future<T> each : list) {
            sum += each.get().longValue();
        }
        return sum;
    }
}