Below is a question from K&B's OCP practice exams book:
Which are true? (Choose all that apply.)
A. Compilation fails.
B. An exception is thrown at runtime.
C. Bang will execute for a second or two.
D. Bang will execute for at least 10 minutes.
E.
Thread t1 will almost certainly be the last thread to finish.
F. Thread t1 will almost certainly be the first thread to finish.
G. It’s difficult to predict which thread will be the last to finish.
Below is answer and explanation from the book:
C and G are correct. The sleep() method’s argument is in milliseconds. E is incorrect
because sleep will be called once on each of the three threads, not on Thread t1 three
times. Remember, the sleep() method is static and operates on whichever thread is
the currently running thread.
But I don't know why C is correct. Could somebody explain it to me?
Thanks.