Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What method is used to create a new thread in a thread pool using a ThreadFactory?

  1. create(ThreadFactory factory)

  2. newThread(Runnable r)

  3. build(ThreadFactory factory)

  4. generate(ThreadFactory factory)

The correct answer is: newThread(Runnable r)

A new thread in a thread pool is created using the newThread(Runnable r) method, which is specifically designed for this task. Other choices such as create, build, and generate do not have anything to do with creating threads in a thread pool, and may be methods used for other purposes. Therefore, B is the correct answer for this question.