Oracle
1Z0-805 · Question #71
Which two fragments can be combined into a statement that returns an ExecuteService instance?
The correct answer is A. Executors E. .newSingleThreadExecutor (). The Executors.newSingleThreadExecutor() method creates an Executor that uses a single worker thread operating off an unbounded queue.
Concurrency
Question
Which two fragments can be combined into a statement that returns an ExecuteService instance?
Options
- AExecutors
- BExecutor
- CExecutorService
- D.getSingleThreadExecutor ();
- E.newSingleThreadExecutor ();
- F.createSingleThreadExecutor ();
- G.buildSingleThreadExecutor ();
How the community answered
(26 responses)- A81% (21)
- B8% (2)
- F8% (2)
- G4% (1)
Explanation
The Executors.newSingleThreadExecutor() method creates an Executor that uses a single worker thread operating off an unbounded queue.
Topics
#ExecutorService#Executors#newSingleThreadExecutor#thread pool
Community Discussion
No community discussion yet for this question.