程旭媛 发表于 2013-8-16 16:37:26

[Oracle interview]What are synchronized methods and synchronized statements?

龚城师 发表于 2013-8-16 16:42:55

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]
查看完整版本: [Oracle interview]What are synchronized methods and synchronized statements?