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

1 Expert Approved Answer
Step: 1 Unlock

The correct answer is D newFixedThreadPool2 Explanation newFixedThreadPool2 creates a thread pool t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!