Java Reference
In-Depth Information
Chapter
12
Lists
Contents
Specifications for the ADT List
Using the ADT List
Java Class Library: The Interface List
Java Class Library: The Class ArrayList
Prerequisites
Introduction
Appendix B Java Classes
Appendix D Designing Classes
Appendix E Exception Handling
Chapter
6
Stack Implementations
Objectives
After studying this chapter, you should be able to
Describe the ADT list
Use the ADT list in a Java program
A list provides a way to organize data. We can have to-do lists, gift lists, address
lists, grocery lists, even lists of lists. These lists provide a useful way for us to
organize our lives, as illustrated in Figure 12-1. Each list has a first item, a last item,
and usually items in between. That is, the items in a list have a position: first, second,
and so on. An item's position might be important to you, or it might not. When adding
an item to your list, you might always add it at the end, or you might insert it between
two other items already in the list.
A list is a collection, and this chapter formalizes it as an ADT.
 
 
 
Search WWH ::




Custom Search