Thread Quextion from examlab Practice Exam 2 (Question 8)
Given the following code fragment:
I choose E) Result is unpredictable
because thread from first execution of for each loop may be already start execution and print some in this line System.out.print(Thread.currentThread().getName()+" "); and before this print or after ma be thrown exception in main thread.
but right answer is G) Run time exception
Is i wrong in my answer, and how this kind of question must be answered?