Skip to content
UPEEC

Java Collections and Data APIs

Lists, sets, maps, queues, streams, Optional, dates, regex and serialisation. The Collections Framework, ArrayList/LinkedList, HashMap and streams/lambdas have their own pages earlier in this subject.

Easy
Comments 0

This is an overview — pick a sub-topic below.

Sub-topics (16)

List Interface

An ordered collection allowing duplicates and index access.

Beginner♥ 0🔖 0💬 0

Set Interface

A collection without duplicates.

Beginner♥ 0🔖 0💬 0

HashSet

A hash-table set with $O(1)$ average operations and no ordering.

Beginner♥ 0🔖 0💬 0

TreeSet

A sorted set (red-black tree) with $O(\log n)$ operations and navigation methods.

Easy♥ 0🔖 0💬 0

Map Interface

Key → value associations.

Beginner♥ 0🔖 0💬 0

TreeMap

A sorted map with $O(\log n)$ operations and navigation (`floorKey`, `ceilingEntry`, `subMap`).

Easy♥ 0🔖 0💬 0

LinkedHashMap

A hash map that remembers insertion (or access) order.

Easy♥ 0🔖 0💬 0

Queue Interface

FIFO operations: `offer`, `poll`, `peek`.

Beginner♥ 0🔖 0💬 0

Deque Interface

Double-ended queue — also Java's recommended stack.

Easy♥ 0🔖 0💬 0

PriorityQueue

A binary heap: `poll()` returns the smallest element (or by a Comparator).

Easy♥ 0🔖 0💬 0

Iterator

Walk through a collection and safely remove elements while iterating.

Easy♥ 0🔖 0💬 0

Method References

Shorthand for lambdas that call an existing method.

Easy♥ 0🔖 0💬 0

Optional

A container that may hold a value — makes "no result" explicit instead of returning null.

Easy♥ 0🔖 0💬 0

Date and Time API

`java.time`: immutable `LocalDate`, `LocalDateTime`, `Instant`, `ZonedDateTime`, `Duration`, `Period`.

Easy♥ 0🔖 0💬 0

Serialization

Convert objects to bytes or text and back.

Intermediate♥ 0🔖 0💬 0

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.