This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
One of your thread (could be first or second) enters in synchronized method and prints X and then comes in waiting state. Then second thread acquires the lock and enters in same synchronized method and prints X and it also comes in waiting state.
your program then will wait forever. You have to manually close program by Ctrl-C