| Author |
What is difference between ArrayList and vector?
|
Mary Jones
Greenhorn
Joined: Apr 22, 2011
Posts: 1
|
|
|
What is difference between ArrayList and vector?
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2946
|
|
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:
ArrayList
(This class is roughly equivalent to Vector, except that it is unsynchronized.)
Vector
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
Greenhorn
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
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
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.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
. . . and welcome to the Ranch Mary Jones.
|
 |
bit developer
Greenhorn
Joined: Feb 03, 2013
Posts: 2
|
|
There are a few differences between arraylist and vector. Visit this link for the differences:
http://www.questionscompiled.com/answer.jsp?technology=java&qid=53
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4905
|
|
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.
Winston
|
Isn't it funny how there's always time and money enough to do it WRONG?
|
 |
 |
|
|
subject: What is difference between ArrayList and vector?
|
|
|