Question d’entretien chez Publicis Sapient

why do we need locks in java multithreading?