Multiple choice technology programming languages

what are the true statement about synchronization

  1. A thread can acquire more than one lock

  2. Each object has just one lock.

  3. all methods in a class must be synchronized

  4. methods,variables can be synchronized,

Reveal answer Fill a bubble to check yourself
A,B Correct answer
Explanation

In Java synchronization, a single thread can acquire multiple locks concurrently, and every object is associated with exactly one monitor lock. It is incorrect to claim that all class methods must be synchronized, as developers selectively synchronize code. Variables cannot be synchronized directly; only methods and blocks can use the synchronized keyword.