Intermediate
Java
Q46 / 100
What does the synchronized keyword do?
Correct! Well done.
Incorrect.
The correct answer is C) Ensures only one thread executes the method or block at a time
C
Correct Answer
Ensures only one thread executes the method or block at a time
Explanation
synchronized acquires a monitor lock on the object (or class), preventing concurrent access and race conditions.
Progress
46/100