Java OCA OCP Practice Question 2286

Question

How can the priority of a thread be set?

Select the one correct answer.

  • (a) By using the setPriority() method in the Thread class.
  • (b) By passing the priority as an argument to a constructor of the Thread class.
  • (c) Both of the above.
  • (d) None of the above.


(a)

Note

The priority of a thread is set by calling the setPriority() method in the Thread class.

No Thread constructor accepts a priority level as an argument.




PreviousNext

Related