How Synchronization works in Java?

后端 未结 8 601
广开言路
广开言路 2020-12-08 21:46

I have a doubt regarding Java Synchronization . I want to know if I have three Synchronized methods in my class and a thread acquires lock in one synchronized method other t

8条回答
  •  孤街浪徒
    2020-12-08 22:04

    Yes.
    To execute synchronized method thread need to obtain lock on object and only one thread at a time can obtain lock on object.

提交回复
热议问题