Ace Java 2025: Rock Your 'Thinking in Java' Challenge!

Question: 1 / 510

Which method reduces the count in CountDownLatch?

reduce()

decrement()

countDown()

The method that reduces the count in CountDownLatch is called countDown(). This method decrements the count of the latch, which indicates that a task has completed. Option A, reduce(), and option B, decrement(), are not applicable to CountDownLatch. Option A is used to combine values in a stream, while option B is used to decrement the count in a separate type of synchronization object called a semaphore. Option D, awaitDecrease(), is not a valid method in the CountDownLatch class. Therefore, the correct answer is option C, countDown().

Get further explanation with Examzify DeepDiveBeta

awaitDecrease()

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy