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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Guest

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

Post by Guest »

Could 2 0 4 not be a possible output as there's no guarantee which JerkyThread starts first?!?
Last edited by admin on Wed Jan 18, 2012 7:32 am, edited 1 time in total.
Reason: Updated the subject to include question id

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: JerkyThread

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 248 guests