jacob deiter wrote:Local variables (including local class variables) specified inside a method is thread safe. Then why Synchronized is used on method?
First, what the heck is a "local class variable"?
But to answer your question, what about local reference variables that reference something that is shared? Maybe passed in via parameter to the method? The local reference may be threadsafe, but the object may not be.