• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the difference between ArrayList and vector  RSS feed

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vector doesn't exist, ArrayList does.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey it is not abstractarraylist it is AbstractList
just open it and see it for the code
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!