Video in progress

Is Vector still used today, and how does it differ from ArrayList?

It is almost never used in new code. Vector is also array-based, but every method is synchronized and it doubles in size when full. ArrayList has no synchronization, grows by 1.5x, and is faster.

📖 Answer

Vector is left over from Java 1.0. Later the Collections Framework came along and ArrayList appeared, and Vector was kept for compatibility by making it implement List.

Having every method synchronized does not give you real thread-safety:

if (!vector.contains(x)) {   // the lock is taken and released
    vector.add(x);           // the lock is taken again — another thread may have added it in between
}

So compound operations still need external synchronization, while simple operations pay for locks they don't need.

What to pick today: a single thread, ArrayList; many reads and few writes, CopyOnWriteArrayList; other cases, Collections.synchronizedList or rethinking the code. You still run into Vector in old libraries (Swing, some legacy APIs).