Mastering Java: The Ultimate Quiz for 'Thinking in Java' 2026 - Free Java Programming Practice Questions and Study Guide

Question: 1 / 510

How can a thread be created using Runnable interface?

By extending the Runnable class

By implementing the Runnable interface and defining the run() method

A This option is incorrect because in Java, extending the Runnable class is another way to create a thread but it is not an option mentioned in the question which specifically mentions using the Runnable interface.

C: This option is incorrect because calling the run() method will not create a new thread. It will simply execute the code in the calling thread.

D: This option is incorrect because we cannot instantiate interfaces directly in Java. Interfaces are meant to be implemented by classes.

In order to create a thread using the Runnable interface, we must implement the interface and define the run() method, as mentioned in option B. The run() method contains the code that will be executed when the thread is started. Therefore, option B is the correct answer.

Get further explanation with Examzify DeepDiveBeta

By calling the run() method

By instantiating the Runnable interface directly

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy