Same point:
- All inherits from Abstractlist and implements the list interface
- Both Randomaccess and cloneable interfaces are implemented.
- The default array size is 10
- All support iterator traversal
Different points:
- ArrayList is non-thread safe;
and vector is thread-safe, its functions are synchronized, that is, all support synchronous
- Serialization support differs:
ArrayList implements the Java.io.Serializable interface
- Capacity increases in number of different:
when the capacity is low, theArrayListnew Capacity "=" (Raw capacity x3)/2 + 1 ""Vectornew capacity "=" raw capacity x 2 "
vector using V.indexof (o, index); The ArrayList uses indexof (O), as shown below:
Vector v =new vector (5); V.indexof (o, index);
ArrayList ArrayList = new ArrayList (); Arraylist.indexof (o);
The author's level is limited, welcome to add correct!
Reference documents
http://www.jb51.net/article/42767.htm the use and performance analysis of JAVA LinkedList and ArrayList
JAVA Vector and ArrayList usage and performance comparison