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.
Wiki User
∙ 2010-03-02 16:58:29In 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.
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.
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.
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
vagina
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); }
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.
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.
The difference is the length of the vector.
They are the same.
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.
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
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.
List is not sync'd as a vector is.
vector is usually is the arthropodes carrying the parasites such as mosquitoes.
a vector drive is vertical, a scalar is horizontal.
Yes. That is the chief reason for the difference between momentum (a vector) and kinetic energy (not a vector).