sponsive (perhaps the user might want toendthe application), youoffload the “obtain
exampleemploys ExecutorService , Callable ,and Future toaccomplishthis
ExecutorService executor = ...; // ... represents some ex-
entries = ...;
Access online dictionaries
with search word and populate
entries with their resulting
// Do stuff.
String entries = taskFuture.get();
After obtaining an executor in some manner (you will learn how shortly), the ex-
ample's main thread submits a callable task to the executor. The submit() method
immediatelyreturnswithareferencetoa Future objectforcontrollingtaskexecution
and accessing results. The main thread ultimately calls this object's get() method to
get these results.