Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes What is the difference between ArrayList and Vector? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the difference between ArrayList and Vector?" Watch "What is the difference between ArrayList and Vector?" New topic
Author

What is the difference between ArrayList and Vector?

Sandeep Mukherji
Ranch Hand

Joined: Mar 23, 2008
Posts: 46
What is the difference between ArrayList and Vector?
is it only that:
i) Vector is thread- safe and ArrayList is not. and
ii) Vector objects suffer a slight performance panelty due to synchronization.
or something more?
Guido Sautter
Ranch Hand

Joined: Dec 22, 2004
Posts: 142
That's basically it.
Plus, Vector provides some additional methods.
In fact, Vector was retro-fitted to implement the List interface in Java 1.2 (from the Java API documentation):
"As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized."
Sandeep Mukherji
Ranch Hand

Joined: Mar 23, 2008
Posts: 46
Thanks a Lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the difference between ArrayList and Vector?
 
Similar Threads
What is difference between ArrayList and vector?
vector and arraylist
Question in Collection?
Vector deprecated in 1.3?
What is the difference between Vector and ArrayList