[Oracle interview]What are synchronized methods and synchronized statements?
Synchronizedmethods are methods that are used to control access to an object. A threadonly executes a synchronized method after it has acquired the lock for themethod's object or class. Synchronized statements are similar to synchronizedmethods. A synchronized statement can only be executed after a thread hasacquired the lock for the object or class referenced in the synchronizedstatement.
页:
[1]