Question: Lets say you needed a thread executor to create tasks for a CyclicBarrier that has a barrier limit of five threads. Which static method in
Let’s say you needed a thread executor to create tasks for a CyclicBarrier that has a barrier limit of five threads. Which static method in ExecutorService should you use to obtain it?
A. newSingleThreadExecutor()
B. newSingleThreadScheduledExecutor()
C. newCachedThreadPool()
D. newFixedThreadPool(2)
E. None of the above
Step by Step Solution
3.50 Rating (153 Votes )
There are 3 Steps involved in it
The correct answer is D newFixedThreadPool2 Explanation newFixedThreadPool2 creates a thread pool t... View full answer
Get step-by-step solutions from verified subject matter experts
