Multiple choice technology programming languages

A lock can be acquired in a class.

  1. True

  2. False

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

In Java, a lock can indeed be acquired on a Class object using synchronized blocks or static synchronized methods. Class-level locks are used to synchronize access to static methods or static data across all instances of the class. The lock is associated with the Class object itself, not with individual instances.