Let it snow~
Let it snow~
Originally posted by Firas Zureikat
For SCJP purposes, I feel that the catch() blocks that SUN puts in the Thread questions are not meant to be considered in determining the possible result like the question above. Unless it's a syntax question then this rule doesn't apply (ofcourse wait() has to be in a try block).
I mean you can't assume that there is an interrruption (like hitting Ctr + x on the keyboard) and following the catch flow above that would lead to printing the interrupted thread's ID instead of really waiting for notify and then printing as Naseem explained.
So in the SCJP, if there is a catch block like above and the question asks what's the possible result like above, you should never assume an interruption takes place, which leads to the print statement after the catch clause and print an ID as a "possible result". So the 6 6 choice is never NEVER true because wait() is never NEVER ever interrupted for the purpose of the exam, right?
SCJP 5.0<br />-----------<br />"Help Ever && Hurt Never"
Consider Paul's rocket mass heater. |