Java OCA OCP Practice Question 2173

Question

Which statements are true?

Select the two correct answers.

  • (a) The class Thread is abstract.
  • (b) The class Thread implements Runnable.
  • (c) The Runnable interface has a single method named start.
  • (d) Calling the method run() on an object implementing Runnable will create a new thread.
  • (e) A program terminates when the last user thread finishes.


(b) and (e)

Note

The Thread class implements the Runnable interface and is not abstract.

A program terminates when the last user thread finishes.

The Runnable interface has a single method named run.

Calling the run() method on a Runnable object does not necessarily create a new thread; the run() method is executed by a thread.

Instances of the Thread class must be created to spawn new threads.




PreviousNext

Related