Results 1 to 6 of 6

Thread: What is the difference between Vector and ArrayList?

  1. #1
    Join Date
    Dec 2009
    Posts
    14

    What is the difference between Vector and ArrayList?

    I am intermediate programmer in the programming world. I have already learned C and C++ basics. Right now i am learning the C sharp, .Net and Java programming language. I have done lots of programs using the array, but recently i was planning to do program using both vector and arraylist and confused should i or not. I also wants to know what is the difference between Vector and ArrayList? Please help me.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: What is the difference between Vector and ArrayList?

    My knowledge of programming world says that both the Vector and ArrayList is mostly similar. They both(vector and arraylist) will represent a "growable array", which will allow to access/use the elements in it through the index. Arraylist is the part of the Java Collection Framework, and it is added to the version 1.2, and whereas the Vector is the object which is present since the first version of the JDK. I would recommend that till you don't have anything special/important to use a Vector, avoid it and use the ArrayList.

  3. #3
    Join Date
    Nov 2005
    Posts
    1,323

    Re: What is the difference between Vector and ArrayList?

    According to me, the major differences between the Vector and Arraylist is, the Vector is synchronized and on the other hand Arraylist is not synchronized. But, i would suggestion that avoid the vector and use the arraylist, until you have any specific requirement of the vector. Vector is little bit complicate to understand compare to arraylist. If you are only practicing, then you should go ahead and use both of them and clear your doubts.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: What is the difference between Vector and ArrayList?

    Good question asked. I think most people would avoid to understand them, because its little bit complex. Firstly, will tell you that the Arraylist are not synchronized, whereas Vector are synchronized. Due to arrayList is not synchronized, it is very fast. Arraylist does not have the default size or default value and on the other hand Vector has default size of 10. Note that we are able to specify the increment size with the vector and whereas with arrayList we are not able to do it.

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: What is the difference between Vector and ArrayList?

    I personally think that may some time Vector is better, while some times ArrayList is better. They are almost similar to each other in function. It is not easy to choose any one out of both. I would say we can choose one(vector or arraylist) depending upon the situation or requirement of the program. Usually, there are four factors which can makes us to choice and they are API, Synchronization, Data growth and Usage patterns. Hope you can choose the correct method.

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: What is the difference between Vector and ArrayList?

    My studies about the vector and arraylist says that there only two differences between both of them. First, the Vector is said to be synchronized and whereas arraylist is not synchronized. Secondly, the Vector are able to increment the size by double,and on the other hand the arraylist are able to increment size by only 50%. One more thing would like to tell you is arraylist have default size, and its false that they don't have default size. Default size is 10 only same as vector.

Similar Threads

  1. Difference between pixel and vector graphics
    By Dino M in forum Windows Software
    Replies: 6
    Last Post: 17-01-2011, 05:45 PM
  2. Using an ArrayList
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 04-03-2010, 12:56 PM
  3. Multithreading and ArrayList
    By Logan 2 in forum Software Development
    Replies: 5
    Last Post: 09-02-2010, 05:16 AM
  4. Initialize an ArrayList
    By TechGate in forum Software Development
    Replies: 5
    Last Post: 09-02-2010, 04:13 AM
  5. ArrayList not working
    By Remedy in forum Software Development
    Replies: 5
    Last Post: 07-02-2010, 04:18 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,940,828.52714 seconds with 17 queries