Multiple choice

Which of the following methods is/are correct for making a new thread? A. Declare a class to be a subclass of Thread class. B. Declare a class that implements the Runnable class.

  1. Only A

  2. Only B

  3. Both A and B

  4. Neither A nor B

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

We can create a new thread using two ways:

  1. Declare a class to be a subclass of Thread class.
  2. Declare a class that implements the Runnable interface.