© Kishori Sharan 2017

Kishori Sharan, Java 9 Revealed, 10.1007/978-1-4842-2592-9_13

13. Collection API Updates

Kishori Sharan

(1)Montgomery, Alabama, USA

In this chapter, you will learn:

  • How unmodifiable lists, sets, and maps were created before JDK 9 and what were the problems in using them.

  • How to create unmodifiable lists using the of() static factory method of the List interface in JDK 9.

  • How to create unmodifiable sets using the of() static factory method of the Set interface in JDK 9.

  • How to create unmodifiable maps using the of(), ofEntries(), and entry() static factory methods of the Map interface in JDK 9.

The Background

The Collection API consists of classes and interfaces that provide a way to store and manipulate different types of collections ...

Get Java 9 Revealed: For Early Adoption and Migration 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.