answersLogoWhite

0


Best Answer

1)Synchronization: Vector is synchronized and arraylist are not. 2)Increment size: Vector can increment the size by double,arraylist can increment it by 50%.

2)The default size of vector has 10, arraylist have 0.

3)we can specify the increment size with the vector and with arraylist we can't.

4)Arraylist is very fast as it is non-synchronized.

User Avatar

Wiki User

2010-03-02 16:58:29
This answer is:
User Avatar
Study guides

What is a programming language

What does DOS stand for

What is a software that is distributed for free

What do unix and Linux have in common

➡️
See all cards
3.95
61 Reviews

Add your answer:

Earn +20 pts
Q: What is difference between ArrayList and Vector?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between arrayList and vector in java?

In use they're almost identical. The only thing you, as the programmer, really need to know is that Vectors are thread-safe and ArrayLists are not.


What is the difference between superclass and subclass in java?

The superclass is the class from which the current class inherits.The subclass is the class which inherits from the current class.class ArrayList extends AbstractList {}Here AbstractList is the superclass of ArrayList and ArrayList is the subclass of AbstractList.


What is difference ArrayList and Vector?

ArrayListThink of this as a growable array. It gives you fast iteration and fast random access. To state the obvious: it is an ordered collection (by index), but not sorted. You might want to know that as of version 1.4, ArrayList now implements the new RandomAccess interface-a marker interface (meaning it has no methods) that says, "this list supports fast (generally constant time) random access." Choose this over a LinkedList when you need fast iteration but aren't as likely to be doing a lot of insertion and deletion.VectorVector is a holdover from the earliest days of Java; Vector and Hashtable were the two original collections, the rest were added with Java 2 versions 1.2 and 1.4. A Vector is basically the same as an ArrayList, but Vector methods are synchronized for thread safety. You'll normally want to use ArrayList instead of Vector because the synchronized methods add a performance hit you might not need. And if you do need thread safety, there are utility methods in class Collections that can help. Vector is the only class other than ArrayList to implement RandomAccess.The only difference between the two is that Vectors are synchronized and hence threadsafe whereas ArrayLists are not. Otherwise they are both identical in terms of their features and usage.


Difference between a queue and a Linked list?

from the abstraction: list you go to the implementation details (concrete): arraylist,vector or linkedlist,circularlinkedlist and maybe more when somebody asks you for a special list in this case (queue) speciality 1 enqueue -add to botton speciality 2 dequeue - remove from top you are free to pick up arraylist,and/or linkedlist and/or circularlists and/or vector to implement your new specialized list called queue. and/or means you might want to combine as well


What is the difference between vector and phaser diagram?

vagina

Related questions

How can you convert ArrayList to Vector?

Both of these types of Collections allow for a new instance to be created with the contents of another Collection. // This method will accept a Vector and return a new ArrayList which contains all elements of that Vector static ArrayList toArrayList(Vector v) { return new ArrayList(v); } // This method will accept an ArrayList and return a new Vector which contains all elements of that ArrayList static Vector toArrayList(ArrayList al) { return new Vector(al); }


What is the difference between arrayList and vector in java?

In use they're almost identical. The only thing you, as the programmer, really need to know is that Vectors are thread-safe and ArrayLists are not.


What is the difference between superclass and subclass in java?

The superclass is the class from which the current class inherits.The subclass is the class which inherits from the current class.class ArrayList extends AbstractList {}Here AbstractList is the superclass of ArrayList and ArrayList is the subclass of AbstractList.


What is the difference between an initial point of a vector and a terminal point?

The difference is the length of the vector.


What is the difference between zero vector and null vector?

They are the same.


What is difference ArrayList and Vector?

ArrayListThink of this as a growable array. It gives you fast iteration and fast random access. To state the obvious: it is an ordered collection (by index), but not sorted. You might want to know that as of version 1.4, ArrayList now implements the new RandomAccess interface-a marker interface (meaning it has no methods) that says, "this list supports fast (generally constant time) random access." Choose this over a LinkedList when you need fast iteration but aren't as likely to be doing a lot of insertion and deletion.VectorVector is a holdover from the earliest days of Java; Vector and Hashtable were the two original collections, the rest were added with Java 2 versions 1.2 and 1.4. A Vector is basically the same as an ArrayList, but Vector methods are synchronized for thread safety. You'll normally want to use ArrayList instead of Vector because the synchronized methods add a performance hit you might not need. And if you do need thread safety, there are utility methods in class Collections that can help. Vector is the only class other than ArrayList to implement RandomAccess.The only difference between the two is that Vectors are synchronized and hence threadsafe whereas ArrayLists are not. Otherwise they are both identical in terms of their features and usage.


Difference between a queue and a Linked list?

from the abstraction: list you go to the implementation details (concrete): arraylist,vector or linkedlist,circularlinkedlist and maybe more when somebody asks you for a special list in this case (queue) speciality 1 enqueue -add to botton speciality 2 dequeue - remove from top you are free to pick up arraylist,and/or linkedlist and/or circularlists and/or vector to implement your new specialized list called queue. and/or means you might want to combine as well


What is difference in resultant vector and vector resolution?

the difference between resultant vector and resolution of vector is that the addition of two or more vectors can be represented by a single vector which is termed as a resultant vector. And the decomposition of a vector into its components is called resolution of vectors.


Main difference between Array List and Vector in Java?

List is not sync'd as a vector is.


What is the difference between a vector and a parasite?

vector is usually is the arthropodes carrying the parasites such as mosquitoes.


What is the difference between scalar and vector drives?

a vector drive is vertical, a scalar is horizontal.


Is Linear Momentum a Vector?

Yes. That is the chief reason for the difference between momentum (a vector) and kinetic energy (not a vector).

People also asked