Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of these statements about the priority constants on Thread is correct?

  • A.MIN_PRIORITY is 0, NORM_PRIORITY is 5 and MAX_PRIORITY is 9.
  • B.MIN_PRIORITY is 1, NORM_PRIORITY is 10 and MAX_PRIORITY is 100.
  • C.The constants vary by platform and are not fixed by the class.
  • D.MIN_PRIORITY is 1, NORM_PRIORITY is 5 and MAX_PRIORITY is 10.

Answer: D

Thread defines these three as 1, 5 and 10, and they are fixed constants rather than platform values. A value outside 1 to 10 causes IllegalArgumentException. What is platform-dependent is the effect of a priority, not the number itself.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.