Difference between ArrayList and Vector

Posted By: Matpal - June 08, 2011
ArrayList it's part of the Java Collection Framework, and has been added with version 1.2, while Vector it's an object that is present since the first version of the JDK. Vector, anyway, has been retrofitted to implement the List interface.

ArrayList is not thread-safe whereas Vector is thread-safe (Synchronized). In Vector class each method like add(), get(int i) is surrounded with a synchronized block and thus making Vector class thread-safe.


Post a Comment

Note: Only a member of this blog may post a comment.