• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Difference between Arraylist and Vector

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic