Section 8: The Collections Framework

  • Make appropriate selection of collection classes/interfaces to suit specified behavior requirements.

  • Distinguish between correct and incorrect implementations of hashcode methods.

Relevant Sections

Read Chapter 11.

Study Notes

The collections framework consists of various interfaces, concrete implementations of collections, and utility classes. Familiarity with the methods defined by the interfaces is required. Some collection interfaces are better suited for certain types of information. Knowledge of which collection implementation is best suited for a particular situation is important.

The hashCode() method of two objects must return the same result if the state of the objects are equal according to the equals() method, and must consistently return the same result as long as the state remains the same. Correct implementation of the hashCode() and its relation to the equals() method must be understood.