Question: Question: What happens if you declare a method as synchronized in Java? A) The method can only be called by one thread at a time
Question: What happens if you declare a method as synchronized in Java?
A) The method can only be called by one thread at a time on the same object instance.
B) The method can be executed by multiple threads concurrently.
C) The method becomes static and is synchronized across all instances of the class.
D) The method prevents deadlock by allowing a thread to acquire multiple locks at once.
Step by Step Solution
There are 3 Steps involved in it
The detailed answer for the above question is provided below The correct option is A The method can only be called by one thread at a time on the same ... View full answer
Get step-by-step solutions from verified subject matter experts
