Answers for "vector vs arraylist"

21

array vs arraylist

Arrays are fixed size
ArrayList's size auotomatically adjusted
Arrays can hold primitives and object
ArrayList can hold only objects
Arrays can be multi dimensional
ArrayList cannot be multi-dimentional
Array is a build in data structure
ArrayList is implementing class of List interface in Collection framework
Posted by: Guest on November-28-2020
5

ArrayList vs Vector

ArrayList is not thread safe/syncronized
Vector is thread safe/syncronized
ArrayList is faster than Vector
Both allow duplicate values and keep ordering
Both are implementations of List interface
Posted by: Guest on November-28-2020
2

array vs vector

- Array contains similar data type. Vector can store heterogeneous data types,
if restriction is not put using generics concept.
- Array has primitive data type, does not belong to Collection family.
Vector implements List interface which is a part of collection hierarchy.
- Array is static and needs to be assigned with the fixed size during
initialization. Vector resizes itself dynamically as per the need. So, 
it is dynamic in nature.
- Array is non-synchronized. Vector is synchronized.
- Array can be traversed using for loop or enhanced for loop. It cannot use
iterator or enumeration interface. Vector can be traversed using iterator 
or enumeration interface.
Posted by: Guest on December-05-2020
3

arraylist vs vector in java

ArrayList is not thread safe
Vector is thread safe/syncronized
ArrayList is faster than Vector
Both allow duplicate values and keep ordering
Both are implementations of List interface
Posted by: Guest on January-06-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language