Vector is a type of collection object that Java has.
Vector is a class that implements the AbstractList class and is often used as an alternative to arrays since it automatically extends the length of the list unlike arrays.
A Vector can contain a collection of objects of any type. But it has fallen out of use due to the rise of the more convenient ArrayList class, but Vectors are still used for their security in multi threaded environment.
Vectors are thread safe but array lists are not.
An important fact to note is that Stack extends the Vector class.
No comments:
Post a Comment