Hi Tim,
For the code that you posted :
The answer is : No thread holds the lock! since at line 12 the code attempts to execute notify() on object a1 without acquiring its lock. Result will be IllegalMonitorStateException
Now, if we fix this code to make it work, it chages to :
In this case the code works and the answer to the same question for this code is :
At when notify is called on object `a1` ( line 24 ), "The main() thread has acquired lock on monitor of object a1".
Note : In case you remove the delay incurred by Thread.sleep(100) from line 24, the thread executed by run() method will never come out of wait because notify is called even before wait is executed in line 6
Cheers,
Amit