O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collection Interfaces

As you saw in Chapter 9, "Interfaces," Java interfaces provide a way to reduce dependencies, or coupling, between classes. When you code to an interface rather than a specific class implementation, you allow for the possibility of multiple classes being available to implement the behavior you need. The collection framework is built on a set of fundamental interfaces. This allows you to choose the proper data structure based on its performance characteristics, without having to worry about the implementation details. The collection framework includes at least one implementation for each of its interfaces, but it also allows you to create your own special purpose collection classes if the need arises.

Note

An interface cannot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required