Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A Vector is an optimized kind of Array that is made to store and retrieve instances of the same class. It behaves almost identically to an Array, but the key difference is that it stores only one type of object, as you can see in Figure 9-1.
In the original Array, you can store all kinds of objects together. In a Vector, you store only one kind. In the preceding example, the Vector only stores instances of Shoe. In this chapter, you'll see when and why this can be useful. I'll also cover the other minor differences between the two data types.