I was going through some old thread related posts for more practice. Found this one which I do not completely agree:
May be sometimes child thread gets the lock first. In that case when it enters into sleep state ,main thread will get the lock and then will enter into wait. again when child comes out of sleep it will notify main .
My points:
1. When a thread goes to sleep, it takes lock with it.
2. After child thread will wake from sleep naturally, it will be dead.
3. Then main thread will resume.
4. It will wait for ever because there is no live thread to notify it.