[email protected]

Implementations of the java.util.concurrent.Callable<V> functional interface represent tasks that are designed to be executed by threads—analogous to implementations of the java.lang.Runnable functional interface. Whereas we can create and start a thread by passing a Runnable to a constructor of the Thread class, this is not possible with a Callable<V> implementation, as Thread constructors do not accept a Callable<V> object. In order to execute an implementation of the Callable<V> functional interface as a task in a thread, we can use an executor service—a topic which we explore thoroughly later (p. 1436).