Is static method thread safe?
I have a static method that takes an integer and returns a mathematically processed result. Since this method is frequently used in a lot of places, I have placed it in a common class and declared it as static, accessing only local variables and not any static variables.
I want to know whether this method is thread safe?
------------------------
suresh
Re: Is static method thread safe?
Any method, static or not, that uses only local variables of primitive type is thread safe. If the method touches any objects, then it may or may not be thread safe, depending on whether those object are used by any other code.
---------------------
suresh