class ABC implements Runnable {
private static int a;
private static int b;
public void run() {
}
}
I have a Java class as above. I hav
Depends on what needs to be thread-safe. For these int
primitives, you'll need either to replace them with AtomicInteger
's or only operate with them within synchronized
method or block. If you need to make your cross-thread Hashtable thread-safe, you don't need to do anything, as it already is synchronized.