Java Associate — Hard
Key points
- ReentrantLock provides more functionalities than synchronized
- synchronized is simpler but less flexible
- ReentrantLock requires explicit unlock(), unlike synchronized
- synchronized is a keyword, while ReentrantLock is a class
- ReentrantLock allows for interruptible lock acquisition
Ready to go further?
Related questions
