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

前端 未结 5 1809
迷失自我
迷失自我 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:05

    FutureTask This class provides a base implementation of Future, with methods to start and cancel a computation

    Future is the interface

提交回复
热议问题