The HashSet<E> and LinkedHashSet<E> Classes The HashSet<E> class implements the Set<E> interface. Since this implementation uses a hash table, it…

Composing Stream Pipelines Stream operations can be chained together to compose a stream pipeline in which stream components are specified…

15.12 The Arrays Class In this section we look at some selected utility methods from the java.util.Arrays class, in particular,…

The NavigableSet<E> Interface The NavigableSet<E> interface extends the SortedSet<E> interface with navigation methods to find the closest matches for given…

16.1 Introduction to Streams A stream allows aggregate operations to be performed on a sequence of elements. An aggregate operation…

16.2 Running Example: The CD Record Class We will use the CD record class and the Genre enum type from…

Searching in Arrays A common operation on an array is to search the array for a given element, called the…

Creating Unmodifiable Maps Creating unmodifiable maps is analogous to creating unmodifiable lists (ยง12.2, p. 649) or unmodifiable sets (p. 804).…

The TreeSet<E> Class The TreeSet<E> class implements the NavigableSet<E> interface and thereby the SortedSet<E> interface. By default, operations on a…

Miscellaneous Utility Methods in the Arrays Class The methods toString() and fill() (Example 15.10, Example 15.11) have previously been used…