Browse Oracle Certification Guides

1Z0-831 Java 25 Collections, Ordering, and Generic Bounds Guide

Study 1Z0-831 Java 25 Collections, Ordering, and Generic Bounds: key concepts, common traps, and exam decision cues.

Collection questions look familiar, which is why they are dangerous. The trap is often an API contract you thought you remembered.

Collections chooser

Requirement Strongest first fit
immutable factory result List.of(...), Set.of(...), Map.of(...)
fixed-size array-backed list Arrays.asList(...)
producer source ? extends T
consumer sink ? super T
order-sensitive reasoning encounter order and collection type both matter

Common traps

Trap Better rule
assuming all read-only looking collections behave the same fixed-size and unmodifiable are different contract families
treating generic types as covariant like arrays generic invariance still applies
guessing wildcard direction use PECS explicitly

Decision order that usually wins

  1. Decide whether the collection is mutable, fixed-size, or unmodifiable.
  2. Check exact generic legality.
  3. Confirm whether order matters.
  4. Only then predict modification or iteration behavior.

Quiz

Loading quiz…
Revised on Sunday, May 10, 2026