what is the advantage of using FutureTask over Callable?

前端 未结 3 1513
野趣味
野趣味 2020-12-25 13:15

There are two approaches to submitting and polling task for result

FutureTask futureTask = new FutureTask(callable);
3条回答
  •  既然无缘
    2020-12-25 13:59

    FutureTask class contains an additional " done()" method so we can override the done() method, then add the FutureTask object to the ExecutorService, so the done() method will invoke when the FutureTask completed immediately.

提交回复
热议问题