Basically the problem is that the last print statement "Code Block 4" does not print. This is because the main thread that calls notify() completes before the second thread (Thread-1) begins. As such when Thread-1 is called it permanently blocked as their is no active thread to call notify().