3 ms·
Correct. It synchronizes on the instance of the PrintStream, which has no effect here. The bottom line is that the Point object should have been immutable, whi
by ddeck 13y ago
Correct. It synchronizes on the instance of the PrintStream, which has no effect here.
The bottom line is that the Point object should have been immutable, which would have made it safe for publication. That requires its fields to be final (among other things), which was not the case.