• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Arraylist and Vector  RSS feed

 
rajaraman navaneethan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,
we know that the difference between Arraylist and Vector is that methods of Vector are synchronized, while that of Arraylist are not.also Arraylist is an addition of Java2.
are there any other differences between these two other than the above mentioned differences?kindly let me know if there are.

regards,
Raja
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if this helps: http://jqa.tmorris.net/GetQAndA.action?qids=53&showAnswers=true
 
rajaraman navaneethan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Tony,
these are the common differences.but i was asked if there are any other differences apart frm this in an interview.
regards,
Raja
 
Tim Cao
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raja,

If you look at the source code, you can see, apart from the differences that you have mentioned, the capacity increment ratio of Vector and ArrayList are different as well. I think Vector's capacity doubles every time its size reaches its capacity, whereas ArrayList's capacity increase by a factor of 1.1 (or something similar).

btw, if that is not confidential, with which company did you have the interviews?

Cheers,

Tim.
 
rajaraman navaneethan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Tim,
Thanks for the reply.i think this was the difference which he expected apart from the common ones.
i had an interview with a CMM level 4 MNC in bangalore.

regards
Raja
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!