Chapter 11. Collections

THIS chapter describes the Java Collections Framework. Here you will learn what collections are and how they can make your job easier and programs better. You’ll learn about the core elements—interfaces, implementations, and algorithms—that comprise the Java Collections Framework.

Introduction to Collections

A collection—sometimes called a container—is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers).

If you’ve ...

Get The Java™ Tutorial Fourth Edition: A Short Course on the Basics 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.