When a thread acquires a lock for a synchronized method, it ________ the entry of other threads for all synchronized methods.

  • blocks
  • ignores
  • permits
  • suspends
When a thread acquires a lock for a synchronized method, it blocks the entry of other threads for all synchronized methods in the same object or class. This means that while one thread is inside a synchronized method, other threads attempting to enter any synchronized method of the same object or class will be blocked until the lock is released by the executing thread. This ensures exclusive access to synchronized methods, preventing data corruption in multi-threaded scenarios.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *