Community

Locks In Java

(Vipul Patel) A lock is a thread synchronization mechanism like synchronized blocks. Locks are implemented internally using synchronized blocks. Therefore, we can use locks instead of synchronized keywords in Java.