aspose file tools
The moose likes Java in General and the fly likes what is the difference between ArrayList and vector Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply 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

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Hi, can any one tell met he difference between ArrayList and Vecotr other than this point

Vecto is synchronized and arraly is is unsynchronize

please tell me some more differences :roll:


thank's in advance
cinux


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
vector doesn't exist, ArrayList does.


42
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by saikrishna cinux:
Hi, can any one tell met he difference between ArrayList and Vecotr other than this point

Vecto is synchronized and arraly is is unsynchronize

please tell me some more differences :roll:


thank's in advance
cinux



That is the main difference.

Until 1.5 vector did not implement List.
In 1.5 it does so, that difference went away.

The best place to look for answers to "what is the difference" questions is the API (which, according to... Vector does, indeed, exist):
http://java.sun.com/j2se/1.5.0/docs/api/java/util/ArrayList.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by saikrishna cinux:

Vecto is synchronized and arraly is is unsynchronize


saikrishna,
I think it's safe to assume that, with 400 posts to your name you know that we like people to use real words and why.

When you mistype or abbreviate words, it becomes difficult if not impossible for our non-English speaking members to read your post via language translation software. This is especially true when the words you're abbreviating are the names of Java classes.

Please take the time to proof-read your questions before posting them.
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hey Ben, dont be serious man i am not doing it intentionally man i was just out of time when i was typing that post
I am sorry for that

and i am happy that i am reached to 400 posts

so i am asking it once again clearly with proof reading

can any once tell me the difference between Vector and ArrayList other than
this Vector is Synchronized and ArrayList is unSynchronized

thanking you
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hey it is not abstractarraylist it is AbstractList
just open it and see it for the code
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
[Ben]: Until 1.5 vector did not implement List.
In 1.5 it does so, that difference went away.


As I recall, Vector was made to retroactively implement List the moment List was introduced into the JDK, back in JDK 1.2. This is backed up by the docs you cite:

"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. "

Cinux, you can find many more discussions of the differences between these two classes by entering "ArrayList" and "Vector" in the search form. I recommend JiG Beginner and Intermediate.


"I'm not back." - Bill Harding, Twister
 
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?
What is the difference between LinkedList and ArrayList ?
Difference between ArrayList and LinkedList?
LinkedList and ArrayList
Question in Collection?