1202 Collections Chapter 21 Outline 21.1 Introduction 21.2 (Web design seattle)
1202 Collections Chapter 21 Outline 21.1 Introduction 21.2 Collections Overview 21.3 Class Arrays 21.4 Interface Collection and Class Collections 21.5 Lists 21.6 Algorithms 21.6.1 Algorithm sort 21.6.2 Algorithm shuffle 21.6.3 Algorithms reverse, fill, copy, max and min 21.6.4 Algorithm binarySearch 21.7 Sets 21.8 Maps 21.9 Synchronization Wrappers 21.10 Unmodifiable Wrappers 21.11 Abstract Implementations 21.12 (Optional) Discovering Design Patterns: Design Patterns Used in Package java.util Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises 21.1 Introduction In Chapter 19, we discussed how to create and manipulate data structures. The discussion was low level, in the sense that we painstakingly created each element of each data structure dynamically with new and modified the data structures by directly manipulating their elements and references to their elements. In this chapter, we consider the Java collections framework, which gives the programmer access to prepackaged data structures, as well as algorithms for manipulating those data structures. With collections, instead of creating data structures, the programmer simply uses existing data structures, without concern for how the data structures are implemented. This methodology is a marvelous example of code reuse. Programmers can code faster and can expect excellent performance, maximizing execution speed and minimizing memory consumption. We will discuss the interfaces of the collections framework, the implementation classes, the algorithms that process them and the iterators that walk through them. Some examples of collections are the cards you hold in a card game, your favorite songs stored in your computer and the real-estate records in your local registry of deeds (which map book numbers and page numbers to property owners). Java 2 provides an entire collections framework, whereas earlier versions of Java provided just a few collection classes, such as Hashtable, Stack and Vector (see Chapter 20), as well as built-in array capabilities. If you know C++, you will be familiar with its collections framework, Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/12/01
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services