Originally posted by Firas Zureikat:
... Since methods and objects have locks, you could synchronize on them. Variable don't have locks...
Not quite. Objects and classes each have locks, but methods do not have locks. To execute a synchronized method, the
thread must first obtain the object lock (or class lock if the method is static).
[ June 01, 2006: Message edited by: marc weber ]