About Question enthuware.ocpjp.v8.2.1317 :
Posted: Mon Dec 16, 2019 2:51 pm
I thought that a monitor object (in this example Object) only synchronized the block for objects of the same type as the monitor object...
So I thought that since the threads created in the code were both Test objects, the synchronized block would not be synchronized for Test objects, only for Object objects...?
Or have I totally misunderstood how this monitor object works for synchronized blocks?
So I thought that since the threads created in the code were both Test objects, the synchronized block would not be synchronized for Test objects, only for Object objects...?
Or have I totally misunderstood how this monitor object works for synchronized blocks?