Question d’entretien chez BNP Paribas

What's Optimistic and Pessimistic Lock in Java?