MathWorks Interview Question

How locks work in Java