CHAPTER 6
ARRAYS AND ARRAY LISTS 
CHAPTER GOALS
To collect elements using arrays and array lists
To use the enhanced for loop for traversing arrays and array lists
To learn common algorithms for processing arrays and array lists
To work with two-dimensional arrays
CHAPTER CONTENTS
Common Error 6.1: Bounds Errors
Common Error 6.2: Uninitialized Arrays
Programming Tip 6.1: Use Arrays for Sequences of Related Items
Random Fact 6.1: An Early Internet Worm
Syntax 6.2: The Enhanced for Loop
Common Error 6.3: Underestimating the Size of a Data Set
Special Topic 6.1: Sorting with theJava Library
Special Topic 6.2: Binary Search
Special Topic 6.3: Methods with a Variable Number of Parameters
6.5 PROBLEM SOLVING: ADAPTING ALGORITHMS
Programming Tip 6.2: Reading Exception Reports
How To 6.1: Working with Arrays
Worked Example 6.1: Rolling the Dice
6.6 PROBLEM SOLVING: DISCOVERING ALGORITHMS BY MANIPULATING PHYSICAL OBJECTS
Video Example 6.1: Removing Duplicates from an Array
Syntax 6.3: Two-Dimensional Array Declaration
Worked Example 6.2: A World Population Table
Special Topic 6.4: Two-Dimensional Arrays with Variable Row Lengths
Special Topic 6.5: Multidimensional Arrays
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access