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 ]
SCJP 1.4 - SCJP 1.6 - SCWCD in progress
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.