Synchronization in Vectors in Java
问题 what is meant by vector in Java is thread safe and synchronized, how is it made thread safe. I'm looking at internal details of implementation 回答1: It is made "thread-safe" by merit of all its methods being synchronized (via the synchronized keyword), see the OpenJDK source code. What the synchronized keyword does is that it prevents more than one thread from executing any of the synchronized methods at the same time. It is using a lock internally, that a thread has to obtain when entering of