Collection Basics

Interestingly enough, none of the Java books I have go into much detail on how to use the JDK collection classes, not even my own! So before we jump in and examine how we might model an XML document via a collection, it's important to understand exactly what collections are and how they can be used.

The JDK provides for what are commonly called collections. Collections, in the simplest sense, are just that: collections of objects. Collections are normally used to store, manipulate, and transmit data from one method to another. Examples of collections might be addresses in a phone book, cards in a playing hand, or any other natural grouping of objects. The JDK goes beyond simple collections and provides a framework for manipulating ...

Get XML Development with Java™ 2 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.