Chapter 7. Arrays and ArrayLists

Begin at the beginning, ... and go on till you come to the end: then stop.

Lewis Carroll

Now go, write it before them in a table, and note it in a book.

Isaiah 30:8

To go beyond is as wrong as to fall short.

Confucius

Objectives

In this chapter you’ll learn:

• To use arrays to store data in and retrieve data from lists and tables of values.

• To declare arrays, initialize arrays and refer to individual elements of arrays.

• To iterate through arrays with the enhanced for statement.

• To pass arrays to methods.

• To declare and manipulate multidimensional arrays.

• To use variable-length argument lists.

• To read command-line arguments into a program.

• To perform common array manipulations with the ...

Get Java™ for Programmers: Deitel Developer Series, Second Edition 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.