Source : OCP java SE programmer Practice Exam.(Q.31)
Which are true? (Choose all that apply.)
A. Compilation fails.
B. After throwing error(s), t3 will most likely complete before t4.
C. After throwing error(s), t4 will most likely complete before t3.
D. The code will throw one error and then no more output will be produced.
E. The code will throw two errors and then no more output will be produced.
F. After throwing error(s) it’s difficult to determine whether t3 or t4 will complete first.
Correct Answere : C I could not understand why option 'E' is not correct because the code will throw two Errors. one error will thrown by "t1" and another error will thrown by "t2".
Please let me know where i am wrong??
Actually my first post was written by mistake and while writing my doubts i didn't knew which forum i am using but when i return to forum then i came to know i posted in a wrong forum then i try to remove post but i did't find any option for deleting post.
Then i did repost my question on the correct forum.
Option E is not correct because although there will be 2 errors thrown, it is highly likely (although not guaranteed) that more output will be produced. This is because there is a new thread being started (t3 and t4) just before the error is thrown so they will continue to run and print separately regardless of the errors being thrown by t1 and t2.