Java SE 17 Developer — Question 27

Which statement is true?

Answer options

Correct answer: D

Explanation

The correct answer is D because a thread in a waiting state can be interrupted and must handle the InterruptedException to manage this scenario properly. Option A is incorrect since moving a thread from waiting to runnable does not throw IllegalStateException. Option B is false as a thread in waiting does not consume CPU cycles, and Option C is incorrect because a thread returns to the runnable state after a timed wait, not terminated.