Hi, Great course! Thanks!
The Ultimate Data Structures & Algorithms: Part 1
9- Dynamic Arrays
“if you have a multi-threaded application where multiple threads are going to work with this collection then you’re not going to be able to use the Vector class”
This is wrong.
The Vector class is thread-safe. The ArrayList is not.
The Vector class synchronizes every method which is too heavy-handed and kills
performance. The ArrayList performs better.
Typically in a multithreaded application you would use the ArrayList as a private member variable in a class, limit access to it to only what is needed, and synchronize only what is needed. (Or ensure that it is only accessed by a single thread in the design of the application.)