If you have a method like:
public synchronized void addOne() { a++; }
this is equivalent to the following: (correct me if I am wrong)
public void addOne() { synchronized(this) { a++; } }
But what is equivalent to the following method ?:
public static synchronized void addOne() { a++;
What is a synchronized block that acts just like a static synchronized method? I understand that a static synchronized method is synchronized with the class, not the instance (since there is no instance), but what is the syntax for this?
source share