As you learn, when a thread enters waiting phase, it does realease the lock until its notified. Here the wait is called on 'this' Object, so when it calls wait() it should release 'this' Object for the next line, System.out.println("B") to execute but that doesn't seem to happen. Could you explain please.
the thread waits until someone calls notify() or notifyAll(). In your example there is nobody which calls those methods, and as result, the thread waits forever. There is a chance that the thread is interrupted, but you shouldn't count on it.