Page 1 of 1

JerkyThread - com.enthuware.ets.scjp.v6.2.144

Posted: Wed Jan 18, 2012 6:39 am
by Guest
Could 2 0 4 not be a possible output as there's no guarantee which JerkyThread starts first?!?

Re: JerkyThread

Posted: Wed Jan 18, 2012 7:22 am
by admin
No, it is not the individual threads that are printing the value. It is the second for loop in the main thread, which is printing the value for other thread's data, and it is printing the values for the threads in order- thread1, thread2, and thread3. So first value will always be 0.

HTH,
Paul.