Appendix B. Miscellaneous library updates

This appendix reviews the main additions to the Java 8 library.

B.1. Collections

The biggest update to the Collections API is the introduction of streams, which we discussed in chapters 4, 5, and 6. There are also other updates discussed in Chapter 9 and additional minor additions summarized in this appendix.

B.1.1. Additional methods

The Java API designers made the most out of default methods and added several new methods to collection interfaces and classes. The new methods are listed in table B.1.

Table B.1. New methods added to collection classes and interfaces

Class/interface

New methods

Map getOrDefault, forEach, compute, computeIfAbsent, computeIfPresent, merge, putIfAbsent, ...

Get Modern Java in Action 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.