Skip to content
Sharp

Java Threading · interview question

What does the ReentrantLock class provide that synchronized blocks do not?

Multiple choiceEasychapter-15-curatedpremiumjava-threadingvirtual-threads
Choose one answer
Answer and explanation

Correct answer

A. Ability to interrupt the lock acquisition

Why

ReentrantLock provides the ability to interrupt lock acquisition, which is not possible with synchronized blocks. This feature allows more flexible and responsive locking mechanisms in concurrent applications.

Test yourself on Java Threading

A free test with instant, explained results. No account needed.

Start free test
All Java Threading questions →