Consider the following snippet,
Class A {
public static synchronized void print() {
//Print something
}
public static void doSomething() {
//Do Something
}
}
Now is it possible for two threads to access print()
and doSomething()
concurrently. Does the lock on print()
affect doSomething()
in this case since the lock on print()
is class level locking. Please clarify me !