We often encounter such a problem in the interview, that is, please briefly describe the difference between the vector and ArrayList containers.
For a while the small partners of Java programming know that the vector class is now rarely used, so it has its drawbacks
Here's a brief explanation of the vector class in the fourth edition of the integrated Java programming idea.
The method in the vector class is final and cannot be extended, which is surprisingly 1, the stack class inherits from the Vector class. This means that stack is a vector, which logically should be justified. And if we create the stack, it's a little bit stricter if it's the final method.
Number two: The most important two methods in vector: AddElement () and ElementAt () are synchronized, which leads to a lot of overhead and may erase the final performance boost. Relatively speaking, ArrayList's behavior is much more reasonable.