Java 25 1Z0-831 cheat sheet for key facts, traps, service mappings, and final review.
On this page
Use this for last-mile review. The goal is not to relearn Java. The goal is to stop the avoidable misses that happen when you skip one type, one feature-status flag, one stream contract, or one exception rule.
1Z0-831 answer sequence
Use this when the stem mixes compile-time legality, preview status, declared type, or Java 25 feature rules.
flowchart TD
S["Snippet or scenario"] --> P["Is any feature preview-only?"]
P --> C["Does it compile?"]
C --> T["What is the exact declared type?"]
T --> R["Check collection, stream, concurrency, or module contract"]
Read every snippet in this order
Does it compile?
Is any feature preview-only?
What is the exact declared type?
What contract actually runs: collection, stream, concurrency, module, or exception?
Only then predict output, side effect, or thrown exception.
Java 25 feature-status matrix
Feature
Java 25 signal to remember
Flexible Constructor Bodies
permanent in Java 25
Stream Gatherers
permanent API before Java 25; still high-yield for Java 25 stream reasoning
Scoped Values
permanent API in Java 25
Structured Concurrency
preview API in Java 25
Module Import Declarations
preview language feature in Java 25
Compact Source Files / instance main model
permanent language feature in Java 25
Primitive types in patterns, instanceof, and switch
preview language feature in Java 25
Java 25 status rule
Do not group all “new Java 25” topics together. Some are permanent, some are preview, and some were finalized before Java 25 but are still modern OCP bait. The safe exam habit is:
identify the construct
decide whether it is permanent, preview, or older-final
only then reason about compile flags, runtime flags, and output
Preview-feature rule
Question type
Better instinct
code uses preview syntax or API
assume preview flags matter unless the official doc says permanent
stem compares new Java 25 features
separate permanent features from preview features explicitly
one answer assumes preview APIs are always on
treat that as suspicious
Preview launch and compile reminders
Situation
Fast reminder
compiling preview code
preview code normally needs preview enablement at compile time
running preview code
preview-enabled compilation does not remove runtime preview requirements
mixed question stem
if one choice ignores preview enablement entirely, pressure-test it hard
exam wording
expect preview-status questions to be partly about recognition, not only syntax
Compile-vs-runtime triage
Ask this first
Why it matters
does the code compile at all?
many distractors disappear before runtime
is the type primitive, wrapper, generic, or inferred?
overloads, boxing, and legality depend on it
is the object mutable, fixed-size, or unmodifiable?
collection questions often hide here
is the stream single-use and still open?
pipeline questions often die here
does any API require preview enablement?
Java 25 now has more feature-status traps
Types and expression rules
Rule lane
Fast reminder
primitive widening
often wins before boxing in overload contests
boxing/unboxing
legal but may create ambiguity or NullPointerException
varargs
last-resort applicability lane, not first choice
compound assignment
can include implicit cast behavior that plain assignment rejects