The Executor framework allows the execution of concurrent tasks that returns a result using the Callable and Future interfaces. The traditional concurrent programming in Java is based on Runnable objects, but this kind of object doesn't return a result.
In this recipe, you will learn how to adapt a Runnable object to simulate a Callable one, allowing a concurrent task to return a result.