SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
1Z0-831 last-day review

1Z0-831 cheat sheet — every exam topic on one page

238 key facts across 10 exam domains — every topic on the 1Z0-831 blueprint, with the exam pattern behind each. A condensed cheat sheet, distilled from the full 1Z0-831 revision notes. Skim it the week of your exam.

Updated

Handling Date, Time, Text, Numeric and Boolean Values

11% of the exam

Java Primitives, Wrapper Classes, Operators and Casting (1Z0-831)

  • A whole-number literal is an int and a decimal literal is a double unless it ends in L or f; a leading 0 means octal.
  • byte, short and char operands are promoted to int before arithmetic, so the result needs a cast to go back to the narrow type.
  • Without a cast, only a compile-time constant of type int or smaller that fits can be assigned to byte, short or char.
  • Compound assignment (+=, *=, ...) and ++/-- carry a hidden cast to the variable's type, so they compile where the long form does not and can overflow silently.
  • Integer casts keep the low-order bits; floating-to-integer casts truncate toward zero, saturate at the type's limits and turn NaN into 0.
  • Integer division truncates toward zero, % takes the dividend's sign, and integer division by zero throws while floating-point division gives Infinity or NaN.
  • int arithmetic wraps on overflow before any assignment to long; make the first operand long, or use Math.addExact and friends to get an exception.
  • && and || can skip their right operand; & and | always evaluate both; && binds tighter than ||.
  • Unboxing null throws NullPointerException, wrappers are immutable, and wrapper equals() is false for a different wrapper type.
  • Math.round returns long for a double and int for a float and breaks ties upward; floor and ceil return double.
How the exam tests this

Objective 1.1 is tested almost entirely through code. Expect short programs that ask what is printed, which statements compile or which change makes code compile, with 'Compilation fails' and runtime exceptions such as ArithmeticException and NullPointerException among the options. Items combine two or more rules in one line: promotion plus a narrowing assignment, postfix increments inside a short-circuited condition, integer division before a widening assignment, or a wrapper compared with equals() against a literal of another type. Trace each expression in the order the compiler groups it and the JVM evaluates it, and keep track of each intermediate value's type as well as its value, because the type decides whether the code compiles and how the result prints.

Java Strings, StringBuilder and Text Blocks (OCP Java SE 25)

  • String is immutable: methods return a new String, and an unassigned result is lost; StringBuilder methods mutate the builder and return this.
  • == on Strings tests identity. Literals, compile-time constant expressions (including final constant variables), text blocks and intern() results share the pooled object; runtime concatenation and new String() do not.
  • Ranges are start-inclusive, end-exclusive. substring needs 0 <= begin <= end <= length(); violations throw StringIndexOutOfBoundsException at run time.
  • + is evaluated left to right pair by pair: numbers before the first String are added, everything after is appended; char + int is an int, and null appends as "null".
  • strip() and isBlank() are Unicode-aware; trim() only removes characters up to U+0020; isEmpty() means length 0.
  • compareTo returns the first char difference or the length difference; uppercase letters sort before lowercase ones.
  • split() takes a regex and, with no limit, drops trailing empty Strings; format conversion mismatches fail at run time.
  • StringBuilder index checks use length(), not capacity; delete/replace clamp an end past the length, while setCharAt/deleteCharAt/charAt throw.
  • StringBuilder.equals() is identity; compare content with compareTo(), contentEquals() or toString().equals().
  • A text block starts on the line after """; the closing delimiter's position controls indentation and the trailing newline; \ joins lines and \s keeps a trailing space.
How the exam tests this

Expect short, complete programs that you must trace exactly: what is printed, whether the code compiles, or whether an exception is thrown. Items combine several calls on one String or StringBuilder, so you need to track whether each call returns a new String or mutates a shared builder, and which variable refers to which object after a reassignment or method call. Identity questions mix literals, constant and non-constant concatenation, new String() and intern(); index questions probe inclusive/exclusive bounds, fromIndex searches and the run-time exceptions. Text block items show several declarations and ask which compile, or render the content with spaces and newlines made visible so the closing delimiter, \ and \s escapes decide the answer. Multiple-answer items compare near-twin methods side by side: strip versus trim, isBlank versus isEmpty, compareTo versus compareToIgnoreCase, indent versus stripIndent, and split with different limits.

Java Date-Time API: Dates, Durations, Periods and Time Zones (OCP Java SE 25)

  • Every java.time object is immutable: plus, minus and with return a new object, and an unassigned result is lost.
  • of() factories validate at run time: months are 1-based, hours 0–23, and 29 February needs a leap year — otherwise DateTimeException.
  • plusMonths, withMonth and withYear clamp to the month's last valid day; withDayOfMonth throws for a day the month lacks.
  • LocalTime arithmetic wraps silently past midnight, but LocalTime differences assume the same day and can be negative.
  • Duration prints PTnHnMnS with no day part (ofDays(3) is PT72H); Period prints PnYnMnD, turns weeks into days, and is only normalized (months into years) when you call normalized().
  • Period.ofX methods are static, so chaining them keeps only the last call; use Period.of(y, m, d) or the withX/plusX instance methods.
  • between() and until() count complete units only; toTotalMonths() folds years into months while getMonths() returns just the component.
  • Unsupported units compile but throw UnsupportedTemporalTypeException at run time: no time units on LocalDate, no date units on LocalTime, nothing beyond DAYS on Instant.
  • withZoneSameInstant keeps the moment and changes the clock; withZoneSameLocal keeps the clock and changes the moment; equals compares zone and local value, isEqual compares the instant.
  • In a DST gap the time moves forward by the gap; in an overlap the earlier offset wins; plusDays and Period keep the wall clock while plusHours and any Duration add elapsed time.
How the exam tests this

Expect short, complete programs that you trace exactly: what is printed, or whether an exception is thrown at run time. Items chain several calls on one value, so track which results are assigned, where a month end clamps, where a LocalTime wraps, and how Duration and Period print. Calculation items compare Period.between, ChronoUnit.between, until and the getX versus toTotalX or toXPart accessors. Type items pair an amount or unit with a class that may not support it; remember the code still compiles. Zone items fix an explicit ZoneId and a stated DST transition date, then ask for the resulting wall-clock time, offset or elapsed duration, so you must know how gaps and overlaps resolve and whether each addition is date-based or time-based. Multiple-answer items line up near-twins side by side: plusHours versus plusDays, Duration.ofDays versus ChronoUnit.DAYS, withZoneSameInstant versus withZoneSameLocal, equals versus isEqual, next versus nextOrSame, and fixed offsets versus region zones.

Implementing Program Flow Control Using Decision and Looping Constructs

8% of the exam

Java Flow Control: if/else, switch and Loops (1Z0-831)

  • Without braces, an else binds to the nearest unmatched if, whatever the indentation, and only one statement belongs to each branch.
  • Conditions must be boolean or Boolean; assigning an int in a condition does not compile, while assigning a boolean compiles and tests the assigned value.
  • Colon labels fall through every following group, including default, until a break; default's position never changes which label matches.
  • Arrow labels never fall through, take one expression statement, block or throw, and cannot be mixed with colon labels in one switch.
  • A switch expression must yield or throw on every path and cannot be left with return, break or continue.
  • A switch expression is exhaustive with a default, an unguarded pattern of the selector's own type, every enum constant, or every permitted subtype of a sealed type.
  • Constant labels need compile-time constants that fit the selector type and never repeat; long, float, double and boolean selectors do not compile in Java 25.
  • A null selector throws NullPointerException unless the switch has case null; default alone does not match null.
  • Pattern labels are tried top to bottom; an unguarded pattern before a subtype or constant label of its type is a dominance error.
  • Inside a switch in a loop, break leaves only the switch and continue goes to the loop's next iteration; continue label needs a loop label.
How the exam tests this

Objective 2.1 is tested through short complete programs that ask what is printed, which lines compile or which statement can be inserted to make code compile, with 'Compilation fails' and runtime exceptions such as NullPointerException among the options. Items combine rules: fall-through from a default placed mid-switch, a dangling else hidden by indentation, a postfix increment inside a loop condition, break or continue inside a switch that sits in a loop, the result type of a switch expression whose arms mix char, int and double, or pattern labels whose order decides both the output and whether the switch compiles. Trace each construct exactly as the compiler and JVM do, check every label against the selector type, and look for exhaustiveness, dominance and reachability errors before computing any output.

Applying Object-Oriented Principles in Java Programs

18% of the exam

Java Objects, Nested Classes and Garbage Collection (1Z0-831)

  • A variable holds a reference, not an object; only new (or an array creation) creates objects, and unassigned reference fields are null.
  • Mutating through an alias changes the shared object; reassigning a variable changes only that variable.
  • Java passes references by value: a method can mutate the caller's object but can never reseat the caller's variable.
  • Inner class objects need an enclosing instance: outerRef.new Inner(); static nested classes use new Outer.Nested().
  • Member and local records, enums and interfaces are implicitly static and cannot use outer instance fields or captured locals.
  • Outer.this.name reaches a shadowed field of an enclosing instance; this in an anonymous class is the anonymous object, in a lambda the enclosing one.
  • Local and anonymous classes (and lambdas) may only capture final or effectively final locals.
  • An object is eligible once no live thread can reach it from a root; unreachable cycles are eligible too.
  • System.gc() is only a request — eligibility is guaranteed by your references, reclamation is up to the JVM.
  • A reachable inner object that uses its outer object keeps that outer object alive; prefer static nested classes when the link is not needed.
How the exam tests this

Objective 3.1 is examined almost entirely through short, complete programs. Expect to read code and state what it prints, whether it compiles, or whether it throws — for example a call through a reference field that was never assigned, or an inner class created from a static context. Instantiation items list near-identical expressions (outerRef.new Inner(), new Outer.Inner(), new Outer.Nested(), this.new Inner()) and ask which compile. Shadowing items mix parameters, this.x and Outer.this.x across one or two levels of nesting. Garbage-collection items give a sequence of assignments and ask which objects, or how many, are eligible at a marked line — with cycles, arrays, static fields, returned objects and inner-to-outer links as the twists — or ask what System.gc() guarantees. Capture items reassign a local after an anonymous or local class uses it, or capture a loop index.

Java Classes, Records, Constructors and Initializers (1Z0-831)

  • A static field is one variable per class shared by every instance; an instance field is a fresh copy in each object, and static code cannot use one without naming an object.
  • The default no-argument constructor exists only when a class declares no constructors; a member with a return type, even void, is a method, not a constructor.
  • A constructor without an explicit this(...) or super(...) gets an implicit super(), which needs an accessible no-argument superclass constructor.
  • this(...) chains complete inside-out; only the constructor that calls super(...) runs the instance initializers, once per object.
  • Java 25 prologues may use parameters, locals, static methods and static fields, throw, and assign the class's own fields without initializers — but never read instance fields, call instance methods, use this or return.
  • Construction order: prologues run from the subclass up; then, from the top class down, each class runs its field initializers and instance blocks in source order followed by its constructor body. Static parts run once per class, parent first, on first active use.
  • A superclass constructor calling an overridden method sees subclass fields at their defaults unless the subclass assigned them in its prologue.
  • Reading a constant variable (final primitive or String with a constant initializer) is inlined and does not initialize the class; a final Integer is not a constant.
  • A blank final field must be assigned exactly once on every constructor path; a checked exception from an instance initializer must be caught there or declared by every constructor.
  • Records generate private final fields, a canonical constructor with the record's access level, public name-matched accessors and a component-listing toString (brackets in current JDKs); compact constructors reassign parameters, non-canonical ones must delegate, and records allow no extra instance fields or instance initializers.
How the exam tests this

Objective 3.2 is examined through short, complete programs that you trace by hand. Expect "What is the result?" items that print markers from static blocks, instance blocks, field initializers and constructors across a parent and child class, or across chained this(...) calls — sometimes with two objects created, so you must know which parts run once. Other items show a record and ask for its toString, accessor results or the effect of a compact constructor, or follow a static field shared by several objects. "Which change makes the code compile? (Select TWO.)" items target the default constructor and implicit super(), blank final fields, record bodies, Java 25 constructor prologues and checked exceptions in instance initializers. "Compilation fails" is a real option on many items, and some programs depend on initialization timing rather than on what the code appears to say.

Java Method Overloading and Varargs Rules (1Z0-831)

  • An overload must differ in its parameter types or their order; return type, parameter names, static, access modifiers and throws do not make a new signature.
  • Overload resolution runs three phases in order — widening, then boxing/unboxing, then varargs — and stops at the first phase with a candidate.
  • Method arguments are never narrowed: an int literal such as 300 does not reach a short parameter, 2.5 does not reach float, and char and short never convert into each other.
  • Among widening candidates the nearest type wins: int before long before float before double, and long widens to float; a wrapper reaches Number or Object in phase 1, before unboxing.
  • Box then widen is legal (int to Integer to Number); widen then box is not (int never becomes Long or Double).
  • null goes to the most specific reference overload; two unrelated applicable types, such as Integer and String, make the call ambiguous, and adding Object does not break the tie.
  • Type... must be the single, last parameter and is an array: it cannot coexist with a Type[] overload, receives an empty array for no arguments, and receives the caller's own array when one is passed.
  • An int[] passed to Object... is wrapped as one element, while a String[] is passed as the array itself.
  • Overloads are chosen from declared types at compile time; a subclass method with a different parameter type is an overload, not an override, so a superclass reference never sees it.
How the exam tests this

Objective 3.3 is examined through short, complete programs that declare two to four overloads and call them with literals, casts, wrapper objects, arrays or null. You are asked what the program prints, whether a declaration or call compiles, or which overloads can coexist. Expect to trace primitive widening chains, the no-narrowing rule for arguments, the order widening-boxing-varargs, the most-specific rule for reference types and its ambiguity errors, and the array a var-arg method receives. Some items combine overloading with inheritance, where the declared type of the receiver decides which methods the compiler can see, or with a mistaken equals overload. 'Compilation fails' is a real outcome, so check that every call has exactly one most specific applicable method before computing output.

Java Variable Scope, Encapsulation, Immutability, var and _ (1Z0-831)

  • A local is in scope from its declaration to the end of its block; it cannot be redeclared in an inner block while still in scope, but a field can be shadowed.
  • A colon-style switch block is one scope, so a local declared under one case is visible (but not initialized) under later cases; arrow cases each have their own block.
  • Locals have no default value: the compiler rejects reads that are not definitely assigned, and it only trusts constant expressions and statement structure.
  • Pattern variables are flow-scoped: in scope wherever the match is known to have succeeded, including after an if whose failure branch cannot complete normally.
  • Lambda parameters live in the enclosing scope and cannot reuse a local's name; an anonymous class method's parameter can shadow it.
  • private is checked per class: code in a class can read the private fields of any instance of that class, but not those of another class in the same file.
  • final is shallow — copy mutable inputs and outputs; Collections.unmodifiableList is a view of the source, List.copyOf is an unmodifiable copy.
  • Blank final fields must be assigned exactly once, in an initializer or in every constructor; in a record, reassign the compact constructor’s parameter to store a copy.
  • var infers the initializer's exact static type — ArrayList<Object> from an empty diamond, the anonymous class itself — and is rejected for fields, parameters, null, bare array initializers and compound declarations.
  • _ declares an unnamed local, for, resource, catch, lambda or pattern variable; it can repeat in one scope, can never be read, and its initializer still runs.
How the exam tests this

Objective 3.4 is examined through short, complete programs. Scope items ask whether code compiles when a name is reused in a nested block, a switch group, a pattern-matching if or a lambda, or what is printed when a parameter, local or pattern variable shadows a field. Definite-assignment items offer several fragments and ask which compile. Encapsulation items ask which access change protects a validated field, or whether a class may read another instance's private field. Immutability items show a class or record holding an array or list and ask what a caller's later change does to it, or which change (or pair of changes) makes it immutable — with final, unmodifiable views and copies as the near-twins. var and _ items list declarations and ask which compile, or rely on the type var infers and on the side effects of unnamed declarations.

Java Inheritance, Polymorphism, Overriding and Sealed Classes (1Z0-831)

  • The reference type decides what compiles — callable members, overload choice and checked exceptions; the object type decides which overriding instance method body runs.
  • An override needs the same signature, the same or wider access, the same or a covariant return type, and no new or broader checked exceptions; different parameter types make an overload.
  • Use @Override on every intended override — it turns an accidental overload into a compile error.
  • private methods are not inherited, final methods cannot be overridden, static methods are hidden, and a method cannot switch between static and instance.
  • Fields are hidden, never overridden: field access resolves by reference type, and an inherited method reads its own class's field.
  • A cast compiles unless no object could satisfy it (unrelated classes, or a final class to an interface it lacks); otherwise a wrong object throws ClassCastException at runtime.
  • Every constructor runs a superclass constructor first; with no explicit call the compiler inserts super(), which fails if the superclass has no no-arg constructor.
  • An overridable method called from a superclass constructor runs the subclass override before subclass fields are initialized — unless Java 25's prologue assigned them before super().
  • Permitted subtypes of a sealed type must be final, sealed or non-sealed; records are implicitly final, extend Record and may implement interfaces.
  • equals must be overridden as equals(Object), together with a consistent hashCode(); an equals(Coord) overload is ignored by collections.
How the exam tests this

Objective 3.5 is examined through short, complete programs that ask what is printed, whether the code compiles, or whether it throws. Dispatch items call methods through a superclass reference and mix in overloads that look like overrides, inherited methods that read hidden fields, static methods called through instance references, and private methods redeclared in a subclass. Override-rule items offer several candidate methods to insert into a subclass — differing in access, return type, checked exceptions, or static/final/private status — and ask which compile. Cast items ask which statements compile and which throw ClassCastException. Constructor items cover a missing no-arg superclass constructor, an overridable method called during construction and Java 25 statements before super(). Sealed items ask which declarations of a permitted subtype compile and whether a pattern switch over a sealed hierarchy with records, guards or a non-sealed branch is exhaustive. Object-method items test equals and hashCode in hash collections and the equals overload trap.

Java Interfaces: Functional, Default, Static and Private Methods (1Z0-831)

  • Interface abstract methods are implicitly public abstract, so the implementing method must be declared public; a blank modifier in a class means package access.
  • An abstract class can implement an interface partially; the first concrete subclass must supply every remaining abstract method.
  • Interface fields are public static final constants: they must be initialized, are inherited by implementers, are shared by everyone, and can never be assigned, though a final array or list can still change its contents.
  • Interfaces cannot declare protected members, blank fields, final or synchronized methods, or default versions of equals, hashCode and toString.
  • Call an overridden default with InterfaceName.super.method(), and only for a direct superinterface; plain super refers to the superclass.
  • Conflict rules in order: a class method wins (even an abstract one, which then must be implemented), then the more specific interface wins (even when it re-abstracts), otherwise the class must override.
  • Static interface methods are not inherited by classes or sub-interfaces: call them only as InterfaceName.method(); a same-signature static method in a class is unrelated.
  • Private interface methods are helpers for code inside the interface; static interface methods can use only private static helpers.
  • A functional interface has exactly one abstract method after inheritance; defaults, statics, privates and public Object methods do not count, but clone() does.
  • @FunctionalInterface only makes the compiler check the count; removing it never turns a two-method interface into a lambda target.
How the exam tests this

Objective 3.6 is tested mostly through short, complete programs that ask what is printed, whether the code compiles, which statement or declaration can be inserted, or which interfaces can be lambda targets. Questions combine several rules at once: an implementing method missing public, constants read through a class name or an instance, static interface methods called without the interface name, private helpers called from static code, X.super pointing at a grandparent interface, and default-method conflicts involving superclasses or re-abstracting sub-interfaces. For functional interfaces, expect to count abstract methods across inheritance, including methods that match Object's and generic redeclarations. Compilation failure is a frequent answer, so check every declaration and call before tracing the output.

Java Enums: Fields, Methods and Constructors (1Z0-831)

  • Constants come first, then a semicolon, then members; every constant's argument list must match a declared constructor.
  • Enums implicitly extend Enum: they can implement interfaces but never extend a class, and no class can extend them; local enums are legal.
  • Enum constructors are private or have no modifier; they can be overloaded and chained with this(...), but super(...) and new are compile errors.
  • All constants are constructed once, in declaration order, at the enum's first use, before any static block or later static field initializer.
  • A constructor cannot reference the enum's static fields (other constants included) except constant variables; indirect access compiles but can be wiped by a later initializer, and values() during construction throws.
  • values() returns a fresh copy each call; valueOf matches name() exactly and case-sensitively, throwing IllegalArgumentException for unknown names.
  • name(), ordinal(), equals() and compareTo() are final; toString() can be overridden, which breaks the valueOf(toString()) round trip.
  • == and equals compare identity; compareTo and sorting follow declaration order.
  • A constant body is an anonymous subclass: it can override methods and implement abstract ones, getClass() returns the subclass, and methods declared only in the body are not callable from outside.
  • Switch expressions over enums must cover every constant or have default; plain switch statements need not, but a variable assigned only in a statement's arms needs a default to be definitely assigned, and default never matches null, only case null does.
How the exam tests this

Most items show a short enum and ask what it prints, whether it compiles, or which declarations, statements or changes are legal. Expect to trace construction order against static blocks and main, to spot illegal static-field references in constructors and the indirect versions that compile but misbehave, to separate name() from an overridden toString() and to know what valueOf accepts, to reason about values() copies, ordinals and natural ordering, to follow dynamic dispatch through constant-specific bodies (including getClass() versus getDeclaringClass() and body-only methods), and to judge whether an enum switch is exhaustive and what it does with null.

Implementing Exception Handling in Java Applications

8% of the exam

Java Exception Handling: try/catch/finally, try-with-resources and Custom Exceptions (1Z0-831)

  • Unchecked means RuntimeException or Error (and subclasses); every other Throwable, including Exception and Throwable itself, is checked and must be caught or declared.
  • catch (Exception e) never catches an Error; finally still runs for one, and a failing static initializer surfaces as ExceptionInInitializerError with the original as its cause.
  • Catches are tried top to bottom: a superclass before its subclass fails to compile, and catching a checked exception the try block cannot throw fails too.
  • An exception thrown inside a catch block goes outward through finally, never to a sibling catch.
  • Multi-catch alternatives must be unrelated, the parameter is implicitly final, and its type is the alternatives' common supertype.
  • A return value is fixed before finally runs; a return, continue, break or throw in finally overrides it or any pending exception, and plain try/finally suppresses nothing.
  • Try-with-resources closes right to left, before its own catch and finally run; resource variables are final and scoped to the try block, and null resources are skipped.
  • The first exception thrown in try-with-resources is primary; later close() failures are suppressed onto it, and a failed initializer closes only the resources before it.
  • A custom exception's toString() is ClassName: message, getMessage() is null when no message was passed, and super(cause) alone copies cause.toString() into the message.
How the exam tests this

Objective 4.1 is examined through short, complete programs that ask for the exact output, whether the code compiles, or which exception escapes at runtime. Flow questions place print statements in try, catch, finally and in nested or calling methods to test execution order, early returns, propagation and what finally does to a pending return or exception. Compile questions offer several catch, multi-catch, throws-clause or resource-header variants and ask which ones are legal, so the rules on catch ordering, unthrown checked exceptions, subclass-related alternatives, final parameters, precise rethrow and effectively final resources matter. Try-with-resources questions combine failing bodies, constructors and close() methods and ask which exception is primary, what getSuppressed() holds and in what order resources close. Custom-exception questions turn on the chosen superclass and on what getMessage(), toString() and getCause() return.

Using Arrays and Collections to Store and Retrieve Data

8% of the exam

Java Arrays and Collections: List, Set, Map, Deque and Sequenced Collections (1Z0-831)

  • New array elements default to 0, 0.0, false, '\u0000' or null; the last index is length - 1; int[] g[] is an int[][]; only the first dimension of new int[3][] is required, and its unassigned rows are null.
  • Arrays don't override equals or toString — use Arrays.equals, Arrays.toString and Arrays.compare/mismatch; clone() of a 2D array shares the rows.
  • Arrays.binarySearch needs a sorted array and returns -(insertion point) - 1 for a missing key.
  • Arrays.asList is fixed-size and writes through to its array (set and sort work); List.of/List.copyOf are unmodifiable (sort throws too) and reject null; unmodifiableList and subList are live views.
  • On a List<Integer>, remove(1) removes index 1; set returns the replaced element; remove inside for-each usually throws ConcurrentModificationException — use removeIf or Iterator.remove.
  • thenComparing only breaks ties, and reversed() reverses the whole comparator chain to its left.
  • HashSet/HashMap need consistent equals(Object) and hashCode; TreeSet uses its comparator for add, contains and remove, keeping the first "equal" element; Set.equals compares elements only.
  • put returns the old value; getOrDefault ignores null values but putIfAbsent overwrites them; a null result from merge or compute* removes the mapping.
  • Deque: push/pop/peek work at the head, offer/add at the tail; poll/peek return null on empty, pop/remove()/element throw, remove(Object) just returns false; ArrayDeque rejects null.
  • Sequenced collections add getFirst/getLast/addFirst/addLast/reversed(); reversed() writes through, and sorted sets/maps and unmodifiable views throw UnsupportedOperationException on positional inserts.
How the exam tests this

Objective 5.1 is examined through short, complete programs that build an array or collection, change it and print it, so expect to state the output, whether the code compiles, or which exception is thrown. Array items probe default values, length versus last index, null rows in ragged arrays, shallow clone of 2D arrays, equals versus Arrays.equals, and binarySearch, compare and mismatch results. List items mix Arrays.asList, List.of, List.copyOf and unmodifiable views, the remove(int)/remove(Object) overloads, the return value of set, and removal inside loops. Set and map items hinge on missing or inconsistent equals/hashCode, comparators that return 0, return values of put, remove, putIfAbsent and getOrDefault, null results from merge and compute, view write-through and factory-map restrictions. Navigation and sequenced items ask for floor/ceiling/higher/lower results, range-view bounds and liveness, which Deque end a method uses and how it behaves when empty, and what reversed(), addFirst and putFirst do on lists, LinkedHashSet, TreeSet, LinkedHashMap and TreeMap — including the calls that throw UnsupportedOperationException.

Processing Data Using Streams and Lambda Expressions

9% of the exam

Java Streams, Lambdas and Primitive Streams (1Z0-831)

  • Nothing runs without a terminal operation; elements then pass through all stages one at a time, and short-circuiting operations stop early.
  • A stream is single-use: a second operation on the same stream object throws IllegalStateException at that call, never a compile error.
  • range excludes its end, rangeClosed includes it; three-argument iterate checks its predicate before every element; iterate and generate without a bound never end.
  • Slicing operations apply in the order written; takeWhile ends at the first failure, dropWhile stops testing at the first failure.
  • On an empty stream allMatch and noneMatch are true and anyMatch is false; findFirst returns Optional.empty.
  • Only primitive streams have sum and average; max, min and average return OptionalInt/OptionalDouble, while sum and count return a primitive 0 when empty.
  • sorted() on non-Comparable elements compiles and throws ClassCastException; reversed() reverses every key before it, and a chained comparing(lambda) loses its target type.
  • IntFunction takes an int, ToIntFunction returns one; methods returning int, long or double are named applyAsInt, applyAsLong, applyAsDouble, while every predicate uses test and BooleanSupplier uses getAsBoolean.
  • Captured locals must be effectively final, but the objects they reference may be mutated; lambda parameters cannot reuse an in-scope local's name.
  • compose runs its argument first, andThen runs it last, and composing a UnaryOperator yields a Function.
How the exam tests this

Objective 6.1 is examined through short, complete programs that ask for one of three things: the exact output, whether the code compiles, or whether it throws at runtime. Pipeline questions place print statements inside intermediate operations to test laziness, element-by-element processing and where short-circuiting stops, or check what happens when a stream is reused or an infinite source is bounded. Data-processing questions chain slicing, mapping, primitive-stream and sorting operations and ask for the result or its type. Lambda and functional-interface questions present several similar-looking declarations or insertion points and ask which ones compile or give a stated result, so precise knowledge of parameter syntax, interface shapes, method-reference kinds and composition order matters more than memorised examples.

Java Stream Reduction, Grouping, Partitioning and Gatherers (1Z0-831)

  • reduce(identity, op) returns T, reduce(op) returns Optional<T>, and reduce(identity, accumulator, combiner) returns a different type U; only the three-argument form can change type, and Optional.stream() turns a result into a zero- or one-element stream.
  • A reduce accumulator that produces null as the final result throws NullPointerException; Optional.empty means only that the stream was empty.
  • Parallel reductions need a true identity, an associative operation and a combiner compatible with the accumulator; an identity is the value that never changes the result (0 for sum, 1 for product, Integer.MAX_VALUE for min, Integer.MIN_VALUE for max).
  • collect(supplier, accumulator, combiner) and Collectors.toCollection are thread-safe because each chunk gets its own container; the combiner must merge its second argument into its first.
  • Empty streams: sum is 0, average is an empty OptionalDouble, max/min are empty Optionals, and summaryStatistics reports count 0 and average 0.0 without throwing.
  • joining needs CharSequence elements and always adds its prefix and suffix; toMap throws IllegalStateException on a duplicate key unless given a merge function (existing value first).
  • Downstream collectors fix the value type: counting is Long, summingInt is Integer, averaging is Double; groupingBy rejects a null key with NullPointerException.
  • partitioningBy always holds both false and true keys, an empty side holding the downstream's result for zero elements; groupingBy only creates keys that occur.
  • Stream.concat is lazy, keeps argument order, needs two streams of the same kind and fails with IllegalStateException on a consumed stream; flatMap treats a null mapped stream as empty.
  • windowFixed leaves a short last window, windowSliding gives one short window only when the stream is shorter than n, fold emits one value, scan emits running values, and mapConcurrent keeps encounter order.
How the exam tests this

Objective 6.2 is examined through short, complete programs that ask for the exact output, whether the code compiles, or whether it throws at runtime. Reduction questions vary the reduce overload, the identity or the combiner and ask what is printed, which expressions compile into a given type, or which are guaranteed to give the same answer on a parallel stream. Collector questions ask for the printed map from groupingBy, partitioningBy, toMap, joining or teeing — often with a map factory, a nested or downstream collector, an empty group, a duplicate key or a null key — or which declaration matches the value type a collector produces. Decomposition and concatenation questions test flatMap and mapMulti typing, concat order, laziness and single-use streams. Gatherer questions ask for the output of the built-in gatherers on edge cases such as partial windows, or trace a custom integrator and finisher to see what is pushed and where the stream stops.

Packaging and Deploying Java Code

9% of the exam

Java Modules, Services and Module Imports (1Z0-831)

  • Cross-module access needs three things: the module reads the other module, the package is exported to it, and the type and member are public.
  • exports names exactly one package; subpackages are unrelated, wildcards do not exist, and a duplicate export of the same package is a compile error.
  • exports p to m1, m2 limits access to the named modules; a missing target only warns, and readability through requires transitive never widens it.
  • Readability is not transitive unless declared: requires transitive gives implied readability and belongs wherever your API exposes another module's types.
  • requires static is mandatory at compile time and optional at run time; the module is resolved only if something else requires it or --add-modules adds it.
  • Cyclic requires fail to compile; a package in two modules (even concealed) stops the boot layer from initializing.
  • exports gives public access; opens (or open module) is needed for setAccessible on private members, otherwise InaccessibleObjectException; opening a missing package warns at compile time but fails at launch; open modules cannot contain opens.
  • Consumers declare uses (or ServiceLoader throws ServiceConfigurationError), providers declare provides S with Impl, and service binding pulls providers in without any requires; uses and provides never create readability.
  • A provider is public and either has a public static provider() method, which wins, or is a concrete subtype of the service with a public no-argument constructor.
  • import module M imports the packages M (and its transitive dependencies) export to you, grants no readability, and loses to on-demand and single-type imports; compact source files import module java.base implicitly.
How the exam tests this

Questions on this objective are mostly multi-module code: several module-info.java files and a few classes, followed by 'What is the result?' or 'Which declaration makes it work?'. Expect to decide whether a reference compiles from readability, exports and public access together, to tell apart compile errors, boot-layer failures and run-time exceptions (NoClassDefFoundError, InaccessibleObjectException, ServiceConfigurationError, NoSuchElementException), and to pick which directives satisfy a stated access requirement. Service items test the uses/provides split, provider validity and ServiceLoader's lazy caching; module-import items test what import module covers, when it needs readability, and how clashing names resolve, including inside compact source files.

Compiling and Running Java: Compact Source Files, JARs, jlink and Module Migration (1Z0-831)

  • A compact source file is an implicitly declared final class in the unnamed package: default constructor only, no package declaration, a required main method, and no code can refer to it by name.
  • Compact source files import all of java.base automatically; java.lang.IO is usable from every class without an import, but an ordinary class must still import java.util.List and friends.
  • The launcher prefers a non-private void main(String[]) (declared or inherited) over void main(); private methods are never candidates; an instance main needs a non-private no-arg constructor, which runs (with field initialisers) first.
  • java File.java compiles in memory, writes no class files, launches the first top-level class in the file, and passes everything after the file name to main; launcher options go before it.
  • Multi-file source programs compile other source files on demand from the root implied by the package; unreferenced files are not compiled; libraries go in --class-path before the file name.
  • javac -d places classes by package; java -cp needs the package root plus the fully qualified class name, or you get ClassNotFoundException or a wrong-name NoClassDefFoundError.
  • java -jar needs a Main-Class manifest attribute and ignores -cp entirely; dependencies come from the manifest Class-Path.
  • A modular JAR is a named module only on the module path; -m module needs ModuleMainClass (jar --main-class), -m module/class always works, and the first module-path entry with a given name wins.
  • jlink links the root modules plus their transitive requires into an image whose --output must not exist; it refuses automatic modules.
  • Named modules cannot read the unnamed module; automatic modules export and open everything and read everything, which is why they bridge migration; split packages on the module path fail resolution.
How the exam tests this

Objective 7.2 is examined mostly through exact commands and short programs: what a given java, javac, jar or jlink command line does, which of several commands works, or what a compact source file or a class with several main methods prints. Expect launcher error messages and exceptions (ClassNotFoundException, NoClassDefFoundError, FindException, ResolutionException, IllegalAccessError) as genuine answers alongside outputs, and multiple-answer items asking which two commands run a program. Distractors lean on near-miss details: an option placed after the file or JAR name, a class path that points inside the package tree, -m given a class name, a JAR on the class path rather than the module path, a file name that derives a different automatic module name, or a jlink run over a graph that still contains an automatic module. Migration items ask about ordering, what the unnamed and automatic modules can read, and why split packages fail.

Implementing Multithreading for Concurrent Code Execution

11% of the exam

Java Threads, Virtual Threads, Executors and Scoped Values (1Z0-831)

  • start() runs the task on a new thread; calling run() runs it on the current thread. A Thread can be started only once: a second start() throws IllegalThreadStateException.
  • Virtual threads are always daemons, have a fixed priority of 5 and an empty default name, support ThreadLocal, and should be created per task, never pooled; setDaemon(false) throws IllegalArgumentException.
  • join() leaves the caller WAITING; sleep(ms) and join(ms) give TIMED_WAITING; BLOCKED means waiting for a monitor. join(ms) just returns when time runs out.
  • Throwing InterruptedException clears the interrupt flag, and a pending interrupt makes sleep throw at once. Thread.interrupted() clears the flag; isInterrupted() does not.
  • A value-returning lambda is a Callable (checked exceptions allowed); a void body is a Runnable. Future.get() returns null for a Runnable and throws ExecutionException, with the task's exception as cause, for a failed task.
  • invokeAll returns futures in task-list order; invokeAny returns one successful result and throws ExecutionException only if every task fails.
  • After shutdown, new tasks are rejected with RejectedExecutionException; shutdownNow attempts to stop running tasks (by interrupting them) and returns the queued ones; close() shuts down and waits for every task.
  • scheduleAtFixedRate measures from start to start, scheduleWithFixedDelay from end to start; a periodic run that throws cancels the rest and makes get() throw ExecutionException.
  • In CompletableFuture, only exceptionally and handle recover from a failure; get() wraps it in ExecutionException and join() in CompletionException.
  • ScopedValue.where(...).run/call binds an immutable value for that call only; get() on an unbound value throws NoSuchElementException, and new threads do not inherit the binding.
How the exam tests this

Objective 8.1 is examined mainly through short, complete programs that ask what is printed, whether the code compiles, or which exception is thrown, plus a few statement-selection items on virtual-thread properties, scheduling and scoped-value semantics. Thread items trace start() against run(), getState() at different points, join with and without a timeout, a second start(), and how interrupts interact with sleep and the two interrupt-status methods. Executor items hinge on which submit overload a lambda selects, what Future.get() returns or throws, invokeAll ordering and invokeAny failure tolerance, the effect of shutdown, shutdownNow and close() on running and queued tasks, and the timing difference between fixed-rate and fixed-delay scheduling. CompletableFuture items follow a failure through a pipeline, and scoped-value items test where a binding is visible: inside run or call, in a nested rebinding, after the call returns, and in a newly started thread. Ordering in these programs is always forced by join, Future.get, a latch, a single-thread executor or close(), so precise knowledge of each method's blocking and exception behaviour matters more than memorised examples.

Java Thread Safety: synchronized, Locks, volatile and Atomic Variables (1Z0-831)

  • count++ and x = x + 1 are read-modify-write: without a shared lock or an atomic class, concurrent updates are lost and the result can change from run to run.
  • A synchronized instance method locks this, a static synchronized method locks the Class object, a block locks the object its expression evaluates to — two calls exclude each other only on the same object.
  • Lock a private final dedicated object; locking a reassigned field, a boxed Integer, new Object() or Thread.currentThread() protects nothing.
  • Intrinsic locks and ReentrantLock are reentrant (hold counts); wait() releases every hold and restores them when the thread wakes.
  • volatile gives visibility and happens-before ordering for single reads and writes, never atomicity of compound actions.
  • getAndX returns the old value, xAndGet the new one; compareAndSet stores only when the current value equals the expected one and returns whether it did.
  • Always lock() then try { … } finally { unlock(); }; unlock() by a non-owner throws IllegalMonitorStateException, and a Lock is never released automatically.
  • lock() ignores interrupts, tryLock() returns at once, tryLock(long, TimeUnit) and lockInterruptibly() throw InterruptedException; there is no tryLock(long) or tryLock(Duration).
  • Read locks are shared and the write lock is exclusive; a writer may downgrade to a read lock, a reader cannot upgrade.
  • wait/notify and Condition need the lock held and a while-loop guard; a latch never goes below zero, a barrier resets each trip and breaks on timeout, and semaphore permits have no owner, and release() can raise the count above its initial value.
How the exam tests this

Objective 8.2 is examined mostly through short, complete programs that share data between threads, so expect to state what is printed, which exception is thrown, whether the code compiles, or whether it can hang. Monitor items ask which object a synchronized method or block locks, whether two calls on given instances can overlap, what Thread.holdsLock reports, and what reentrancy allows in nested blocks and super calls. Race items show unsynchronized or wrongly locked counters and ask for the possible results or the changes that guarantee a correct total. Atomic items trace getAndX versus xAndGet, compareAndSet, updateAndGet and accumulateAndGet. Lock items check the try/finally idiom, hold counts, IllegalMonitorStateException on an unowned unlock, the return values and checked exceptions of lock, tryLock, timed tryLock and lockInterruptibly, and read-write lock sharing, upgrade and downgrade. Coordination items cover wait/notify and Condition ownership and ordering, latch counts and timed awaits, barrier trips and broken barriers, semaphore permit arithmetic and ownership, and the difference between deadlock, livelock and starvation and their remedies.

Java Concurrent Collections and Parallel Streams (1Z0-831)

  • Synchronized is not concurrent: Vector and Collections.synchronizedX make single calls safe, but their iterators still fail fast; java.util.concurrent iterators never throw ConcurrentModificationException.
  • Iterate or check-then-act on a synchronized wrapper inside synchronized (wrapper); the wrapper's own forEach is already locked, its stream is not.
  • ConcurrentHashMap and the other concurrent maps reject null keys and values; a null returned from a compute or merge function means "no mapping" and removes or skips.
  • Use merge, compute or computeIfAbsent for read-modify-write on a ConcurrentHashMap; get-then-put loses updates.
  • ConcurrentSkipListMap/Set are the sorted, thread-safe TreeMap/TreeSet; ConcurrentHashMap.newKeySet() is the unordered thread-safe set.
  • CopyOnWriteArrayList iterators are snapshots: writes during a loop are allowed and invisible to it, and Iterator.remove throws UnsupportedOperationException.
  • On a full or empty BlockingQueue, add/remove throw, offer/poll return false/null, put/take wait — and put, take and the timed versions throw the checked InterruptedException.
  • The last parallel() or sequential() call sets the mode for the whole pipeline.
  • Ordered parallel streams keep encounter order in results (toList, joining, findFirst, skip, limit, distinct, sorted), never in side effects; forEach is unordered, forEachOrdered is not.
  • Collect parallel results with a collector; toConcurrentMap needs a merge function for repeated keys, and groupingByConcurrent does not keep order within groups.
How the exam tests this

Objective 8.3 is tested mostly with short programs that ask for the output, an exception, or a compile error, plus scenario items that ask which collection or method meets stated constraints. Expect to trace loops that modify plain, synchronized or concurrent collections; to judge how ConcurrentHashMap treats null arguments and null-returning functions; to tell atomic compound updates from multi-step ones; to read the results of BlockingQueue calls on full or empty queues, including whether InterruptedException must be handled; and to judge which parallel-stream results are guaranteed and which depend on thread timing. Some items ask you to choose more than one answer.

Performing Input and Output Operations Using the Java I/O API

11% of the exam

Java I/O Streams: Console and File Readers, Writers and Streams (1Z0-831)

  • Reader/Writer subclasses are character streams; InputStream/OutputStream subclasses are byte streams — PrintStream prints text but is a byte stream.
  • read() returns 0–255 (or a char) and -1 only at end of stream; read(buf) returns a count and leaves the rest of the array untouched.
  • readLine() drops the terminator, returns "" for a blank line and null at end of stream; a trailing terminator adds no empty line.
  • Decorators wrap only their own family; InputStreamReader and OutputStreamWriter (or PrintWriter over an OutputStream) bridge bytes and characters.
  • Closing a wrapper flushes and closes the inner stream; a closed file or console stream then throws IOException on use, in-memory streams ignore close(), and a second close() is harmless.
  • Opening a file for writing truncates it unless the opening constructor is given append = true; PrintWriter's boolean is autoflush, not append.
  • Buffered output reaches its destination only on flush(), close() or a full buffer; PrintWriter autoflush covers println, printf and format only.
  • PrintStream and PrintWriter swallow IOException (check checkError()), including in flush() and close(), except PrintStream.write(byte[]); most other java.io methods, close() included, declare it.
  • DataInputStream reads big-endian bytes back in the order written and throws EOFException at the end; bulk reads return empty arrays instead.
  • System.console() can be null; Console.readPassword returns char[], and java.lang.IO offers only print, println and readln.
How the exam tests this

Objective 9.1 is examined mainly through short, complete programs that read or write in-memory streams, files or the console, followed by "What is the result?" or a blank to fill. Expect loops over read(), read(byte[]) and readLine() where the end-of-stream signal, an ignored read count or a blank line changes the output; files written twice where truncate versus append decides the content; and writers read back before or after flush(), close() or a PrintWriter autoflush call. Compile-or-not items offer near-identical wrapper chains (BufferedReader over an InputStream, PrintStream over a Writer) or swap Console and System.out method calls whose return types and checked exceptions differ. Other items count bytes produced by DataOutputStream or by a given charset, ask what happens when a closed inner stream is used, compare redirected standard output and standard error, or show a compact source file using java.lang.IO with empty input or a missing printf method.

Java Serialization and Deserialization: Serializable, transient and serialVersionUID (1Z0-831)

  • Serializable is checked at run time: writing an object graph that reaches a non-serializable value throws NotSerializableException; null fields and static fields are never a problem.
  • readObject returns Object, declares IOException and ClassNotFoundException, and signals the end of the stream with EOFException, never null.
  • transient fields come back as 0, false or null because no initializer or constructor of a serializable class runs; only the first non-serializable superclass's no-arg constructor runs, and it must be accessible.
  • Static fields are not saved: after reading they show the class's current value in the reading JVM.
  • serialVersionUID must be a static final long with that exact name; with matching UIDs, added fields read as defaults and removed fields are ignored.
  • Custom writeObject/readObject must be private and non-static, should call defaultWriteObject/defaultReadObject first (omitting them is not detected, but non-transient fields are then not saved), and must read extra data in write order.
  • readResolve (an instance method returning Object) keeps singletons single; writeReplace plus a proxy's readResolve forms the serialization-proxy pattern.
  • Records are rebuilt through the canonical constructor and ignore readObject/writeObject; enums serialize by name and stay ==; Externalizable needs a public no-arg constructor and saves only what writeExternal writes.
  • Writing the same object twice on one stream writes a back-reference; use reset() or writeUnshared() to write its new state.
  • An ObjectInputFilter pattern is matched left to right, first match wins, unmatched classes are undecided, and a rejection throws InvalidClassException; set it before the first read.
How the exam tests this

Objective 9.2 is examined through short programs that write an object and read it back, asking what is printed, whether it compiles, or which exception is thrown and when. Expect to trace transient, static and newly added fields to their values after a round trip, to work out which constructors and initializers run for ordinary classes, records, enums and Externalizable classes, and to judge whether serialVersionUID, writeObject/readObject and readResolve declarations are recognised exactly as written. Multiple-answer items ask which declarations, expressions or changes produce a given result, including stream-level behaviour such as back-references, reset() and writeUnshared(), and the left-to-right matching of deserialization filter patterns. Keep the checked exceptions of readObject and the runtime timing of NotSerializableException clear in your mind.

Java NIO.2 Path and Files API: Build, Traverse, Read and Write (1Z0-831)

  • Creating or manipulating a Path never touches the disk; only Files methods and toRealPath do.
  • The root is not a name element: getNameCount, getName and subpath count only the names after it, and subpath is zero-based, end-exclusive and relative.
  • getParent, getRoot and getFileName return null when the component is missing; out-of-range indexes or an empty range for getName or subpath throw IllegalArgumentException.
  • resolve appends a relative argument, returns an absolute argument as is, and never normalizes; resolveSibling resolves against the parent.
  • relativize climbs to the common ancestor with .. and throws IllegalArgumentException when one path is absolute and the other relative.
  • Paths are immutable: discard the result of normalize or resolve and the original is unchanged.
  • startsWith, endsWith and equals compare whole name elements and roots, not characters.
  • createFile and createDirectory need the parent and refuse existing targets; createDirectories builds parents and is idempotent for directories.
  • copy and move take the full target path, need REPLACE_EXISTING to overwrite, and never act recursively; delete fails on a non-empty directory, deleteIfExists returns false for a missing one.
  • Passing any open option stops CREATE and TRUNCATE_EXISTING being implied (WRITE always is); Files.lines, list, walk and find are lazy and must be closed.
How the exam tests this

Objective 9.3 is examined through short code: a Path expression or a complete program that builds a small directory tree in a temporary directory, followed by "What is the result?" Path items assume a Unix-style file system and hinge on exact output — name counts with and without a root, subpath bounds, null components, resolve with an absolute argument, relativize climbs, normalize edge cases with leading .., and element-wise startsWith/endsWith. Files items ask whether a sequence of createFile, createDirectory, copy, move or delete calls succeeds or which exception it throws, what a file contains after writes with different StandardOpenOption combinations, and how many entries list, walk, find or walkFileTree report for a given tree and depth. Multiple-answer items list near-identical expressions and ask which return an equal Path, which throw, or which evaluate to true, including attribute checks with NOFOLLOW_LINKS and isSameFile on missing files. Scenario items ask which approach reads a huge file lazily while releasing the handle.

Developing Applications with Localization Support

7% of the exam

Java Localization: Locales, Resource Bundles and Formatting Numbers, Dates and Messages (1Z0-831)

  • Locale.of never validates, forLanguageTag never throws for an ill-formed tag ("de_CH" gives Locale.ROOT), and Locale.Builder throws IllformedLocaleException; toString uses underscores, toLanguageTag hyphens.
  • Locale.setDefault(loc) resets the general default and both categories; a category call changes only FORMAT or DISPLAY. Formatters read FORMAT, getDisplay… names read DISPLAY, getBundle's fallback reads the general default.
  • getBundle searches the requested locale (most specific first), then the default locale, then the base bundle; any partial match on the requested locale beats the default. A Locale.ROOT request takes the base bundle when it exists and tries the default only when it does not.
  • Missing keys resolve up the parent chain (es_MX → es → base); the default locale's files and sibling locales are never parents. getLocale() reports the bundle actually loaded.
  • MissingResourceException is unchecked and comes from getBundle (no bundle) or getString/getObject (no key anywhere in the chain).
  • A ListResourceBundle class beats a same-named properties file; property values are Strings, and getString on a non-String value throws ClassCastException.
  • In MessageFormat a lone apostrophe starts literal text (use two), unmatched placeholders print as {n}, {0,date} cannot format a LocalDate, and parse returns an Object[] or throws the checked ParseException.
  • NumberFormat and DecimalFormat round HALF_EVEN (4.5 → 4, 5.5 → 6); java.util.Formatter (String.format, formatted, printf) rounds HALF_UP.
  • NumberFormat.parse reads a leading number, returns Long or Double and throws the checked ParseException; java.time parsing throws the unchecked DateTimeParseException.
  • Pattern formatters resolve SMART (April 31 → April 30), LocalDate.parse is STRICT, and STRICT needs uuuu; LONG/FULL time styles need a zone.
How the exam tests this

Objective 10.1 is examined through short, complete programs, often with the contents of several .properties files or a ListResourceBundle class listed beside them, followed by "What is the result?" or a "Which two…" placeholder to fill. Expect to trace getBundle with a given default locale to the bundle chosen, its getLocale() and each key's value through the parent chain, or to a MissingResourceException or ClassCastException; to follow Locale.setDefault calls in order and decide which category each API reads; to compare how Locale.of, forLanguageTag and Locale.Builder treat unusual input; and to compute exact output of MessageFormat patterns (quotes, missing or repeated arguments, percent, integer and choice types), NumberFormat, currency, percent, compact and DecimalFormat instances where HALF_EVEN ties and locale symbols decide the digits, and String.format with and without a Locale. Parsing items ask for the Number type and value returned, whether ParseException must be handled, and how SMART, STRICT and LENIENT resolve an impossible date. Date-time items hinge on pattern letters (M versus m, h versus H), localized FormatStyles per locale, and the zone that LONG and FULL time styles need.

Facts fresh? Prove it.
Drill 1Z0-831 practice questions with an explanation on every option.
Practice now

Where these 1Z0-831 facts came from

1Z0-831 cheat sheet: your questions

Every key takeaway from all 24 1Z0-831 revision lessons — 238 facts — pulled onto one page and grouped by exam domain, with the exam pattern behind each topic. It is a compression of the notes, not a separate set of content, so it can never contradict them.

Source

Exam structure, domain weights and scoring on this page come from the official 1Z0-831 exam guide.