Please refer to the following code of from the Javadoc of Future class:
FutureTask<String> future =
new FutureTask<String>(new Callable<String>() {
public String call() {
return searcher.search(target);
}});
executor.execute(future);
P.S: I am not doing any exclusive executor.submit(future)
call here .
So I am trying to execute the future task here by calling executor.execute()
method. But how is the task getting submitted to the executor framework in the first place? Which line of code above is actually submitting the task to the executor ?