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

Hesey picture Hesey · Feb 10, 2011 · Viewed 29.5k times · Source

Since use ExecutorService can submit a Callable task and return a Future, why need to use FutureTask to wrap Callable task and use the method execute? I feel they both do the same thing.

Answer

fmucar picture fmucar · Feb 10, 2011

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

Future is the interface