Java Reference
In-Depth Information
11
Java Collections
In This Chapter
Collections Background
Ordered Collections: Vectors and ArrayLists
Keyed Collections: Hashtable and HashMap
Other Collections
Iterators
Ordering and Comparison Functions
Exercises: Java Collections
Reviewing the Exercises
Collections provide the ability to manage groups of objects. A collection can be or-
dered or unordered, contain duplicates or not, depending upon the particular im-
plementation chosen. Collections can also contain key-value pairs to provide a
facility for maintaining in memory an index of objects.
What's wonderful about collections for the COBOL programmer is the auto-
matic memory management that lies behind the group of objects. Unlike COBOL
arrays, space does not need to be allocated in advance for a fixed number of objects
in this collection. You can simply define the collection and add objects to it as
needed, without any concern for running out of space. The only limitations are
those of the physical memory of the machine or operating system.
263
Search WWH ::




Custom Search