✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Lets say that we define a Java class that will store two lists, foo and bar. Both of these lists will be updated by other concurrently executing threads. So we create two synchronized methods, one to provide write access to foo, and the other to provide write access to bar.
How many intrinsic (i.e., automatic or transparent) locks does the object provide in this case?