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

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

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

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.