About Question com.enthuware.ets.scjp.v6.2.484 :
Posted: Sat Apr 09, 2011 6:50 am
As the sentence threadcounter++; is not atomic and synchronization in run() is not effective (because each thread will get a lock of a different TestClass object) wouldn't be a more correct answer something like this?:
Total of 5 numbers will be printed (some may be repeated or missed) with "N Done" anywhere in the sequence where N cannot be determined.
Total of 5 numbers will be printed (some may be repeated or missed) with "N Done" anywhere in the sequence where N cannot be determined.