If you are a veteran Java programmer, you may have used the Vector class whenever you needed a dynamic array. Why use an ArrayList instead of a Vector? For one simple reason: All methods of the Vector class are synchronized. It is safe to access a Vector object from two threads. But if you access a vector from only a single threadby far the more common case your code wastes quite a bit of time with synchronization. In contrast, the ArrayList methods are not synchronized.
We recommend that you use an ArrayList instead of a Vector whenever you don't need synchronization.