I search the forum and on the internet, but seems there is no
thread answering my doubt. So I would like to post a new thread to make clear.
I have a
servlet, which in turns call another class (e.g. class X{...} ), in which there is a class variable (e.g. static Map map = Collections.synchornizedMap(..)). In servlet, all variables are local (inside doGet/ doPost) and class variable (e.g. static class ...{} ). But in the class X, it has instance method (e.g. doSomething()) where it would operate actions similar to `if put absent' scenario. For instance,
Consider this scenario. the method doSomething() inside class X will be thread safe?
Thanks for help.