1Z0-830 Tests What the Compiler Rejects and Prints — Not Java You Write Daily
This professional exam targets developers fluent in modern Java. Expect dense snippets on records, sealed types, pattern matching and virtual threads, where the right answer is often does not compile.
Check Your Readiness →Most candidates understand Java SE 21 Developer Professional (1Z0-830) concepts — and still fail. This exam tests how you apply knowledge under pressure.
Oracle lists ten sections without weights; I/O and Localization are combined here to fit. Fifty items in 120 minutes leaves over two minutes each, which you need: most present code and ask for output or the failing line, and several are multiple-select.
Output is t, then the catch, then both close calls
Resources close in reverse declaration order immediately after the body, before catch and finally. With R("1") and R("2") the output is tc2c1xf. A close() exception thrown after a body exception is attached as suppressed.
Both a.n and a.get() return the subclass value B
Fields and static methods are hidden and resolve by reference type; only instance methods are polymorphic. a.n reads A's field and a.get() runs B's override, so a.n + a.get() prints AB.
The map holds only the true key
partitioningBy always creates both Boolean keys, so the empty side maps to 0 or an empty list. counting() yields Long values, so declaring Map<Boolean, Integer> fails to compile. toMap throws on duplicate keys without a merge function.
volatile makes the final total exact
volatile guarantees visibility only; count++ is a read-modify-write that still interleaves. Use AtomicInteger.incrementAndGet, synchronized or a ReentrantLock released in finally. Where nothing enforces order, choose the answer saying output cannot be determined.
Record accessors use the component name, so Circle(double r) exposes r(). A compact constructor may validate or reassign the parameter, but this.r = r fails because fields are assigned automatically afterwards. Records cannot declare extra instance fields; static ones are allowed.
case CharSequence c before case String s is a compile error: the String label is dominated. Put narrower patterns and guarded ones (case Circle c when c.r() == 0) first. Without case null, a null selector throws NullPointerException.
Every direct subtype named in permits must be final, sealed or non-sealed, or compilation fails. Records are implicitly final, so they qualify. A switch covering every permitted subtype is exhaustive and needs no default branch.
Virtual threads are always daemon threads, so main can exit before they print. Use join, or Executors.newVirtualThreadPerTaskExecutor() in try-with-resources, since ExecutorService.close waits for submitted tasks. Never pool virtual threads in a fixed-size executor.
Intermediate operations are lazy, so Stream.of(1, 2, 3).peek(System.out::print).map(n -> n * 2) prints nothing. A stream is single-use: a second terminal call throws IllegalStateException. IntStream.average() returns OptionalDouble, not double.
Strengthen weak areas with exam-style practice questions and detailed explanations.
Simulate the real exam experience and assess your readiness under timed conditions.
Review key concepts, objectives, and exam topics in one place.
Get personalized explanations, learning recommendations, and instant answers.
Follow a structured learning path designed to help you prepare efficiently.
1Z0-830 punishes one missed modifier. See whether you spot what the compiler would reject.