What's the difference between Future and FutureTask in Java?

前端 未结 5 1818
迷失自我
迷失自我 2020-12-13 08:37

Since use ExecutorService can submit a Callable task and return a Future, why need to use FutureTask to wrap

5条回答
  •  没有蜡笔的小新
    2020-12-13 09:02

    You would only need to use FutureTask if you want to change its behaviour or access its Callable later. For 99% of uses, just use Callable and Future.

提交回复
热议问题