1.vector is synchronized. Therefore, it is safe to use in multithread programs. On the other hand,arrayList is not synchronized, it need to call a function to synchronize. Therefore, it is faster than vector.
2.Vector is build on old framework, it does not need to indicate a type of this vector, for example:
Vector v = new Vector();
arrayList, on the other hand, need to indicate the type of this array.
ArrayList
Vector and arrayList in C# is very similar to Java. However,vector in C++ is more like arrayList, not vector in Java.
No comments:
Post a Comment