______ 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.
Loading...
Related Quiz
- Which method is used to execute SQL queries in JDBC?
- The ________ method of DatagramSocket class is used to send a packet to a server.
- If you do not define a constructor, Java provides one default constructor that initializes all instance variables with ________.
- The relational operators are often used inside the ______ statement to produce boolean value.
- Which arithmetic operator is used to perform exponentiation in Java?