The lock is being acquired when either thread enters the synchronized block ???
The confusing thing about this code is that it requires knowledge of javastring's and how they are intern'ed , this kind of thing should never appear in real code, you'd be more likely to find it in a java quiz or the like i.e. don't use "a" or any other string literal as your lock.
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad: