wood burning stoves 2.0
The moose likes Beginning Java and the fly likes What is 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 difference between ArrayList and vector?" Watch "What is difference between ArrayList and vector?" New topic

What is difference between ArrayList and vector?

Mary Jones

Joined: Apr 22, 2011
Posts: 1
What is difference between ArrayList and vector?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

You mean java.util.ArrayList and java.util.Vector ? if yes, please search in Beginners Forums or Java In General forums >> SearchFirst

Update: I asked for the clarification as this was earlier posted in JavaFX forum.

Mohamed Sanaulla | My Blog
Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

Literally from the Java API:

(This class is roughly equivalent to Vector, except that it is unsynchronized.)

Unlike the new collection implementations, Vector is synchronized.

Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
swapnil kataria
Ranch Hand

Joined: Feb 26, 2011
Posts: 64
as said above vector is synchrnoized and 2nd thing vector are accessible by iterator and enumeration both,
Randall Fairman

Joined: Apr 18, 2011
Posts: 29

ArrayList is much faster than Vector, and only takes something like 10% more time to access than a simple array. I forget exactly where I saw this, but it wouldn't be a very hard thing to verify for yourself.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20273

Much faster? Perhaps a few Java versions ago when the (mostly unnecessary) synchronization had a bigger performance hit, but these days the difference in performance is probably minimal.

How To Ask Questions How To Answer Questions
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
. . . and welcome to the Ranch Mary Jones.
bit developer

Joined: Feb 03, 2013
Posts: 2

There are a few differences between arraylist and vector. Visit this link for the differences:

Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8927

bit developer wrote:There are a few differences between arraylist and vector...

You do realize that you've replied to a post that's nearly two years old? I suspect Mary has left the building.


Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
I agree. Here's the link: http://aspose.com/file-tools
subject: What is difference between ArrayList and vector?
It's not a secret anymore!