497
Explain yourselves, comp sci.
(mander.xyz)
A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.
Rules
This is a science community. We use the Dawkins definition of meme.
No. ArrayList is thread safe and implements the collections API. Vector doesn't. Though if you're using Java, there's almost no instance where you would want to use a Vector instead of ArrayList.
ArrayList isn't thread-safe, though...
Thread safe as in it raises an exception instead of breaking your list.
Only 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.
For everything else, there's
Collections.synchronizedList(new ArrayList<>())