What is the purpose of passing parameter to synchronized block?
Because it doesn’t matter whether I pass String’s instance, Some random class’s instance to the synchronized block as the synchronized block works perfectly irrespective of the parameter being passed to the block. The purpose of the parameter is twofold: It makes it possible to synchronize other blocks on the same object, so that if you … Read more