Skip to main content

Basic Data Structures: Lists, Sets, and Maps

  • Chapter
  • First Online:
Java Challenges
  • 2322 Accesses

Abstract

In the Collections framework, lists, sets, and maps as key-value stores are implemented by so-called container classes. They manage objects of other classes. The interfaces List<E>, Set<E>, and Map<K,V> from the package java.util serve as the basis for the container classes. They store object references. Thus, processing primitive types is only possible if they are converted to a wrapper object (such as Byte, Integer, or Double). This is done automatically by the auto-boxing/unboxing implicit since Java 5.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Please note that java.util.Stack was created long before the Collections Framework existed and is based on java.util.Vector. The class Stack was later refactored so that it could be integrated into the Collection framework. But, even in the beginning, it should not have to be derived from Vector. Instead, delegation would have been appropriate.

  2. 2.

    For details, see my book Der Weg zum Java-Profi [Ind20a].

  3. 3.

    Records are treated in greater in detail in my book Java – die Neuerungen in Version 9 bis 14: Modularisierung, Syntax- und API-Erweiterungen [Ind20b].

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Inden, M. (2022). Basic Data Structures: Lists, Sets, and Maps. In: Java Challenges. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7395-1_7

Download citation

Publish with us

Policies and ethics