As mentioned earlier, Vector is one of the few collection classes that have existed since the first release of Java. In terms of behavior, Vector is similar to ArrayList.
- [Instructor] The vector's data structure.…As mentioned earlier, vector is one…of the few collection classes that have existed…since the early releases of Java.…Vector is very similar to the behavior of an ArrayList.…One of the early benefits of the vectors,…was that they provided automatic synchronization…which made them threat safe.…Vector by necessity takes a worst case approach…to synchronization which causes its performance to suffer.…
With vectors you can specify initial size,…and a value for how much capacity…should be added each time it needs to grow.…Vectors are not in wide use now.…Most people use ArrayList, but I wanted…to show you an example of how you could create a vector.…Let me switch over to Netbeans.…In your exercise files folder under chapter 02, 02 05…you'll find two files.…The VectorExample.java and the VideoGame.java.…The VideoGame.java file…is actually representing the class…for a video game which has instance data…that represents the title, the year,…the rating, and the platform.…
We're going to use that class…
In this course, explore data structures in the Java language. Follow Peggy Fisher as she introduces you to several types of commonly-used data structures in Java. Peggy explores ArrayLists and LinkedLists, both of which implement the List interface, which extends the Collection interface and allows you to access list elements in a specific order. She also goes into the Vector, Stack, and Queue collection classes. To help you better understand these new concepts, Peggy wraps up the course with a challenge—creating a grocery list—and provides a solution for that challenge.
- Reviewing the types of data structures
- Working with the Collection interface and Iterable interface
- Working with ArrayLists and LinkedLists
- Using the Vector, Stack, and Queue collection classes