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
Get Java For Everyone: Compatible with Java 5, 6, and 7, 2nd 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.