created: 06/25/2006; revised: 07/05/2007, 05/25/2008, 07/25/2010, 05/27/2014, 07/19/2016, 07/23/2019

go to home page   go to next page highlighting

CHAPTER 85 — ArrayLists and Iterators

Programs frequently keep data in lists. Often, arrays are used for this. Arrays are a fundamental feature of most programming languages. Java has arrays and also includes the ArrayList class, which works like an array with extra methods and features.

Like an array, an ArrayList contains elements that are accessed using an integer index. However, unlike an array, the size of an ArrayList is not fixed. An ArrayList expands as needed as items are added to it.

The class ArrayList is one of the standard classes that students are expected to know for the Advanced Placement test given in the United States. Every AP test for the past several years has included a programming problem involving this class.

Chapter Topics:


QUESTION 1:

(Review: ) Examine the following:

String[] list = new String[3];

What is the length of the array referenced by list?


go to home page   go to next page