Collection Implementations

This section covers techniques for using some of the implementation classes. It is not exhaustive, but it is illustrative.

Note

It is possible to create your own implementations of the interfaces using the abstract implementations, such as AbstractList. In fact, the abstract classes provide implementation for some of the methods. You just need to provide the implementations for some of the basic methods.

The class names for implementation classes are made of two parts: the implementation name and the interface name, such as HashMap, a Map implementation based on hashing. Table 19.1 shows the main implementation classes by interface.

Table 19.1. Implementation Classes for Each Main Collection Interface
Interface ...

Get PURE 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.