If we make a method synchronized then all the instance method will be locked while executing that method or only the other synchronized methods will be locked?
Asked
Active
Viewed 17 times
-3
-
don't use the title as content at least add some more information – Kalariya_M Nov 01 '17 at 12:24
1 Answers
0
Well, if the synchronized method is static then it will be synchronized for all instances, otherwise it will be synchronized for a specific object which called it. if 1 object tried to access the synchronized method and the object has two calls to that method then the second call can't be proceed until the first operation is done

Basil Battikhi
- 2,638
- 1
- 18
- 34