Filling a blank in Java Executors code

Report a typo

Consider the following snippet of Java code:


try {
    ExecutorService executor = Executors.newFixedThreadPool(10);
    List<Callable<Integer>> callables = new ArrayList<>();
    // Assume Exception throwing Tasks are added to the callables
    // ___(1)___
} catch(InterruptedException | ExecutionException e) {
    System.out.println("Exception occurred!");
}

Fill the blank (represented as ___(1)___), to execute all the callables - implicitly handling exceptions in the callables - and to retrieve the results when all tasks have finished execution. Select the statements that best fit the blank.

Select one option from the list
___

Create a free account to access the full topic