• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference b/w Vector and an ArrayList

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please tell me all differences b/w a Vector and an ArrayList
**Plz also tell the situations in which each one of them should be used
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Questions such as this are addressed in the JavaDocs for the java.util package. No-one should try to be a Java programmer without knowing how to navigate in the JavaDocs. If you have room on your hard drive why not download and install a copy.
Bill
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your one stop for clear understanding of differences between collection framework classes

You should be aware of old java collections and new java collections classes

http://www.informit.com/guides/content.asp?g=java&seqNum=95
 
Ranch Hand
Posts: 257
Hibernate Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raj Kumar Bindal:
Please tell me all differences b/w a Vector and an ArrayList
**Plz also tell the situations in which each one of them should be used



Hi Raj,

Please download and install the JAVA DOC. It will solve most of your doubts.

There is only one fundamental difference between the Vector and ArrayList, even though both implement from same base interface.

The Vector is synchronized, means it is thread safe. Only one thread of your application can access a vector at a time.

Where as the ArrayList is not synchronized.

As you see, ArrayList gives more performance when you want to access elements from middle of the list and insert and delete in end positions only.

Thank you.

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You posted the same question twice.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic