1.
Array has fixed length
<-> arraylist is dynam
2.
Stored in contiguous
memory location in Java Heap
-
1. Vector and ArrayList are index based and backed up by an array internally.2. Both ArrayList and Vector maintains the insertion order of element. Means you can assume that you will get the object in the order you have inserted if you iterate over ArrayList or Vector3. Both Iterator and ListIterator returned by ArrayList and Vector are fail-fast.4. ArrayList and Vector also allows null and duplicates.
No comments:
Post a Comment