This chapter, when boiled down to its essence, is about data structures. Specifically, it is about arrays—the
java.util.ArrayList classes. An array is a region of memory that can be addressed using a single variable name. It provides an efficient technique for accessing data in a sequential or random fashion. The
Arrays class provides support for arrays while the
ArrayList class provides array-like behavior but is not fixed in size.
We are concerned with how to create and use these data structures. A common operation is the traversal of an array or collection. We will see that Java supports several approaches permitting us to move through the elements of an array or an
ArrayList object. ...