Synchronizing work() is a big mistake, by doing so, you are allowing only one worker to monopolize the work. It is a good thing for the other worker since he/she won't work but still be paid :) but we need to be fair :)
Thread.sleep() has no attribute in solving the problem
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |