Source:
www.danchisholm.net Question:
What are the possible results of attempting to compile and run the program?
a. Prints a number greater than or equal to 0
b. The number printed must always be greater than 10000
c. This program will run for at least ten seconds
d. Compile-time error
e. Run-time error
The answer given is : a and c
I am not sure how c is correct, because if there is an interruption to the sleeping
thread, an InterruptedException is thrown and the program halts. In such a case, the thread will run lesser than 10 seconds, and hence option c is not correct, right?