This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diff between Arraylist and vector

 
kapil bhate
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please anybody tell me diff. between arraylist and vector?and which is better to use ?also i know only differnce is that vector is Syncronized
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think this is a jsp question.
APart from the difference you have mentioned, in Vector you can set the increment value.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64825
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
sever oon
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main difference is that Vector is synchronized. More minor differences--it was retrofit into the Collections API and therefore isn't as standard as ArrayList, which was provided as a new part of the Collections API. As far as I can see, when writing new code there is absolutely no reason to use Vector at all...I always prefer ArrayList, even if I need a synchronized one:

sev
 
kiran kiran
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the advantages of using arraylist compared to vector?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic