Yes, I should have said that the number will be greater than or equal to 10000.
The purpose of the question was really to point out that the InterruptedException is not thrown when the interrupt method is invoked on a
thread that is not sleeping or waiting or blocking in the not-runnable state for any other reason.
I should probably mention that the real exam does not place a lot of emphasis on the interrupt method or the yield method. I try to avoid the use of the yield method but I used it in this question because the sleep method could cause the InterruptedException to be thrown.
Here's another interesting point. We all assume that the sleep method causes a thread to sleep for a period of time that is at least as great as the time specified by the argument. However, in reality, the actual behavior of the sleep method--at least on a Windows system--is a little different. Instead--on Windows--the actual sleep period can be shorter than the time specified by the argument. Has anyone seen this behavior documented anywhere? Does Sun acknowledge it?