Comment on Explain yourselves, comp sci.
DaPorkchop_@lemmy.ml 1 year agoOnly if one thread modifies it while another one is iterating over it, if two threads try to modify the list at once there isn’t any kind of synchronization and it really could break your list.
joyjoy@lemm.ee 1 year ago
For everything else, there’s
Collections.synchronizedList(new ArrayList<>())