Mention 5 basic difference between Array List and Vector in Java Colletion FrameWork.

Vector is unsynchronized wheras ArrayList is synchronized.

Showing Answers 1 - 28 of 28 Answers

RAJESH

  • Nov 2nd, 2005
 

Both arrylists are dynamically grows.The main difference is that VectorList is Sychronised one ,whereas ArrayList is non-synchronised one.Written By Rajesh.

  Was this answer useful?  Yes

Bandana Panda

  • Nov 2nd, 2005
 

Mention 5 basic difference between Array List and ...

  Was this answer useful?  Yes

Prasanna

  • Nov 4th, 2005
 

Vectors are synchronized. Any method that touches the Vector's contents is thread safe. Arraylist, on the other hand, is unsynchronized, making them, therefore, not thread safe.

Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent.

  Was this answer useful?  Yes

upendral

  • Nov 7th, 2005
 

three difference i can mention :arraylist performance is better than the vectorarraylist doesnt supports synchronization while vector does supportvector is optimized for random access than arraylist

  Was this answer useful?  Yes

dibin

  • Nov 7th, 2005
 

vector is synchronised and arraylist is unsynchronised ( sorry i said the reverse)

  Was this answer useful?  Yes

Bhupender Giri

  • Nov 9th, 2005
 

Vector is a legacy class but ArrayList is not

Vector is thread safe but ArrayList is not

ArrayList give better performance as Vector has to suffer this due to synchronisation.

  Was this answer useful?  Yes

Haripriya

  • Nov 10th, 2005
 

Ans: Vector is syncronized where as arraylist is unsyncronized

  Was this answer useful?  Yes

Anuj kaushik

  • Nov 11th, 2005
 

1. vectors are synchronized while array list are not.

2. vectors grows double in size while array list grows just 50%.

3. Array list are faster than vector as they are unsyncronized.

  Was this answer useful?  Yes

rajesh

  • Nov 14th, 2005
 

ArrayList is unsynchronised and vector is synchronised.

  Was this answer useful?  Yes

kiran

  • Jan 12th, 2006
 

answer please. Good site

  Was this answer useful?  Yes

jj

  • Mar 25th, 2006
 

I dont understand why everybody is giving the same answer. If the answer, they know is already there, why do they want to repeat it?

  Was this answer useful?  Yes

Biranchi

  • May 16th, 2006
 

1)ArrayList is not synchronised but vector is.

2)ArrayList is faster than Vector.

3)Vector having default size 10 ArrayList is 16

4)ArrayList is a Class where as Vector is a legacy class. 

  Was this answer useful?  Yes

sathish

  • May 23rd, 2006
 

1.vector is synchronised,Arraylist is not

2.Vector contains legacy methods that are not part of the collections framework

3.Both vector and arraylist grow dynamically

  Was this answer useful?  Yes

sathish.R

  • May 23rd, 2006
 

1.Vector is synchronized,Arraylist is not

2.Vector contains legacy methods that are not in the collections framework

3.Both Vector and Arraylist grow dynamically

  Was this answer useful?  Yes

Habeeb Mohmed

  • Jun 15th, 2006
 

1) The ArrayList class Implements the List interface.  The Vector class is the legacy class that has been retrofitted to implement the List interface.

2)The Vector and Araylist classes are implemented using dynamically resizable arrays, providing fast random access and fast list traversal-very much like using an ordinary Array.

3) Unlike the ArrayList class, the Vector class is thread-safe, meaning that concurrent calls to the vector will not compromise its integrity.

4)The ArrayList and Vector classes offer comparable performance, but vector objects suffer a slight performance penalty due to synchronization.

5)Position-based access has constant-time performance for the ArrayList and Vector classes. However, position-based access is in linear time for a Linked List, owing to traversal in a doubly-linked list.

In most cases, the ArrayList implementation is the over-all best for  implementing lists.

  Was this answer useful?  Yes

Venkataratnam

  • Aug 15th, 2006
 

 Initial size vector is 10       Arraylist is no such size declered

 Vector is synchronized one Array list not synchronized

 Vector supports Enumeration Arraylist support Collection

 Vector is thread safe            ArrayList not thread safe But we can do it 

 Process of  Vector is slow compare with arraylist  

  Was this answer useful?  Yes

philipp

  • Sep 1st, 2006
 

 vector is synchronized arraylist not..

vector having methods addelement(),elementAt(). arraylist dont have 

  Was this answer useful?  Yes

Tafazzul hasan

  • Feb 21st, 2007
 


Differences between Vector and Arraylist

   a> A Vector is Thraed-Safe or we can say that Methods of a Vectors are Synchronized. Where as an ArrayList is not Thread-Safe or we can say that Methods of  an Arraylist are not Synchronized.

  b> As the methods of a Vectors are Synchronized so it  takes slighly more amount of time to execute Synchronized methods and we can safely access Vector from multiple Threads.      As the methods of an ArrayList are not Synchronized, so overhead of executing Synchronized methods is eliminated, but we can not safely acces ArrayList from multiple Threads.

  Was this answer useful?  Yes

1. default arraylist size is 0 at initialization and vector is 10
2. vector is synchronized arraylist not
3. vector increase its size double and arraylist half its initial size
4. vector comes with legency classes but arraylist not
5. vector cms with jdk 1.4 arraylist not

 

  Was this answer useful?  Yes

nextcome

  • Jul 31st, 2010
 

ArrayList vs Vector

1. Not thread-safe - Thread-safe
2. Default size  0  - Default size is 10
3. Faster - Slower
4. Belongs to legacy classes - Belongs to Collection framework
5. User Iterator (fail-safe) - Enumator (no guarantee)

Thanks

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions