E.1 Introduction

This appendix introduces data structures—collections of related data items. Arrays are data structures consisting of related data items of the same type. Arrays make it convenient to process related groups of values. Arrays remain the same length once they’re created, although an array variable may be reassigned such that it refers to a new array of a different length.

Although commonly used, arrays have limited capabilities. For instance, you must specify an array’s size, and if at execution time you wish to modify it, you must do so manually by creating a new array. At the end of this appendix, we introduce one of Java’s prebuilt data structures from the Java API’s collection classes. These offer greater capabilities than ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.