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 interface do you implement for a class to fulfill a task but not return any value?

  1. Callable

  2. Executors

  3. Runnable

  4. Thread

The correct answer is: Runnable

The correct interface to implement for a class to execute a task but not return a value is the Runnable interface. Option A, Callable, is incorrect because it is used when a value needs to be returned. Option B, Executors, is incorrect because it is a class that provides static utility methods for executing tasks. Option D, Thread, is incorrect because it is a class rather than an interface.