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
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.