1.

Can A Method Be Static And Synchronized?

Answer»

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) {
}

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) {
}



Discussion

No Comment Found