【javaマルチスレッド】セグメント乗算
4232 ワード
階乗スレッドクラス:Factorial.javaは値を返す必要があるため、Callableインタフェースを実現し、call()は計算結果を返す
Main.java:
import java.util.concurrent.Callable;
public class Factorial implements Callable
Main.java:
public class Main {
public static void main(String[] args) throws InterruptedException, ExecutionException {
Factorial c = new Factorial(1,10);
FutureTask