Machine-translated by Google. Questions are authored in English.
Top

Discussion

A pool needs its worker threads named and marked as daemons. Which method does it call on the ThreadFactory it was given?

  • A.Thread create()
  • B.void newThread(Runnable r)
  • C.Runnable newThread(Thread t)
  • D.Thread newThread(Runnable r)

Answer: D

A ThreadFactory turns a Runnable into a Thread, so it takes the task and returns the thread, which lets a pool name its threads or mark them as daemons consistently. Returning void would leave the pool with nothing to start.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.