A static method can be synchronized. If you do so, the JVM will obtain a lock on the java.lang.Class instance associated with the object. It is similar to saying: synchronized(XYZ.class) { }
Static methods can be synchronized. Synchronization has to deal with code which leads to deadlock or some uncertainity. The static methods can be accessed by diffrent threads. No problem in synchronization them
A static method can be synchronized. If you do so the JVM will obtain a lock on the java.lang.Class instance associated with the object. It is similar to saying: synchronized(XYZ.class) { }
Each object has a lock associated with it. When any thread attempts to access a synchronized member it must first acquire the associated objects lock. Once one thread owns the lock no other thread may acquire the lock until the owning thread releases it which happens automatically when the synchronous operation completes. You can even make static members synchronized. Then the lock affects all objects of a given class not just one particular instance.