This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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