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.
Hi, Thomas. Synchronized prevents one thread from printing the messages while the other is still doing it. Take off the synchronized and run and you�ll see the mess. When the running threads get to the point where the synchronized block is, it mustget the lock to this object before getting into it. If the lock belongs to the other thread, it will wait untill the lock is available again. Hope I have answered your question, Marcos. [ November 08, 2002: Message edited by: Marcos R Oliveira ] [ November 08, 2002: Message edited by: Marcos R Oliveira ]