Adding a little more... it also makes no difference whether there's one method, or two. What's important is whether or not more than one
thread can access the method or methods. If so, then the method(s) must be written in a thread-safe manner, using synchronization or other techniques.
[Mike]: Thanks...wouldn't the best solution be to just include the class' static private static variables inside the static method that uses them? It depends on what you mean by "include". If you make the variable a local variable inside the method,
instead of a class or instance variable, then yes, that will work great. But if you use any non-final instance or class variable,
at all, then you need to take additional steps (usually, synchronization) to make it thread-safe.
The other techniques are more complicated to figure out how to use safely. They include using volatile or atomic data types, or possibly ThreadLocal or other ways to restrict thread access to mutable data. The details are best discussed by a book such as
Java Concurrency in Practice or
Java Threads.
[ June 01, 2007: Message edited by: Jim Yingst ]