Java 21 New Feature: Sequenced Collections
Explore the principles of Sequenced Collections, Sets, and Maps, a new feature introduced in JDK 21. Dive into the Sequenced Collections API, part of the Collections Framework, which models collections with a defined encounter order and provides direct access to first and last elements. Learn about the architecture of the Collections API, understand the concept of sorted collections, and discover how elements are ordered using indexes. Compare Lists and SortedSets, examine the encounter order for various collection types, and explore the properties of LinkedHashSet. Investigate the common behaviors among different collection types and understand the defining characteristics of sequenced collections. Follow the implementation of SequencedCollection and SequencedSet in the Collections API, and see how Deque implements SequencedCollection. Gain insights into iterating over Map elements, including SortedMap and NavigableMap, and get introduced to SequencedMap. Finally, learn about creating unmodifiable views using the Collections factory class in this comprehensive 20-minute video on Java 21's new Sequenced Collections feature. Read more