nerdexam
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)
  • A
    81% (21)
  • B
    8% (2)
  • F
    8% (2)
  • G
    4% (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.

Full 1Z0-805 Practice