______ is an example of an explicit lock in Java.

  • CountDownLatch
  • ReentrantLock
  • Semaphore
  • Synchronized
ReentrantLock is an example of an explicit lock in Java. It provides a more flexible and fine-grained way to manage locks compared to the built-in synchronized keyword. It allows for features like reentrant locking and fairness policies, making it suitable for complex synchronization scenarios. The Synchronized keyword is also used for locking, but it is implicit and less flexible. The other options are not examples of explicit locks.
Add your answer
Loading...

Leave a comment

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