Originally posted by Raj Kumar Bindal:
Please tell me all differences b/w a Vector and an ArrayList
**Plz also tell the situations in which each one of them should be used
Hi Raj,
Please download and install the JAVA
DOC. It will solve most of your doubts.
There is only one fundamental difference between the Vector and ArrayList, even though both implement from same base interface.
The Vector is synchronized, means it is
thread safe. Only one thread of your application can access a vector at a time.
Where as the ArrayList is not synchronized.
As you see, ArrayList gives more performance when you want to access elements from middle of the list and insert and delete in end positions only.
Thank you.