1Z0-829 — Frequently Asked Questions
Community-vetted answers to 36 common questions about this exam.
Questions from real practice questions
Each Q&A comes from a specific community question — follow the link for its full analysis.
Java Stream reduce with Identity and Combiner
In parallel streams, the combiner merges partial results. Here, it combines "wTable" and "wChair".
Yes, since it uses a two-argument reduce without a combiner on a small list, the order of addition doesn't change the final string for this specific case.
Java Concurrent Thread Execution Order
No. Volatile ensures visibility of changes across threads but does not impose any ordering or mutual exclusion on execution flow.
AtomicInteger uses CAS (Compare-And-Swap) instructions at the hardware level, allowing non-blocking increments without acquiring locks.
Java Method Overloading with Binary Literals
Only if it is explicitly suffixed with an uppercase L (e.g., 0b1101_1010L). Otherwise, it is always an int.
The value 0b1101_1010 (218 decimal) fits comfortably within the positive range of a 32-bit signed int.
Java Sealed Interfaces Compilation Rules
You can, but it restricts further extension to only the permitted subclasses listed in the permits clause. Use 'non-sealed' to allow unrestricted implementation.
No, 'public' is optional. The critical requirement is the sealing modifier (sealed, non-sealed, or final) when extending another sealed type.
Java instanceof Pattern Matching and Method Invocation
Because C does not override mB(), the inherited implementation from B is used. Polymorphism only applies to overridden methods.
No. The variable v is statically typed as B. To call mC(), you must re-bind v to a variable of type C using another instanceof check, as shown with v1.
FileReader buffer read behavior in Java
It does append. The first write adds '01234567'. The second write adds '89'. The total is '0123456789'.
It would write the entire 8-char buffer every time, including old data, leading to corrupted output like '0123456789234567'.
Java Text Blocks and String Equality
myTextBlk1's closing quotes are on the same line as the text, so no newline is added. myTextBlk2's closing quotes are on a new line, adding an implicit newline.
No. intern() ensures that strings with identical values share the same reference, but it does not change the value of the string itself.
Java String Immutability and indexOf Result
No, Strings are immutable. replace() returns a new string; the original variable remains unchanged unless reassigned.
Because the variable 'a' was never updated with the result of replace(), so it still points to the original string containing 'Java' at index 7.
Java Thread Waiting State and InterruptedException Handling
No. Threads in waiting or blocked states are inactive and yield the CPU to other threads until they become runnable.
It moves to the runnable state to contend for the monitor lock or CPU resources, not directly to terminated.
Java Switch Statement Output Without Break
In Java, switch statements do not automatically stop after a match unless a break statement is explicitly used. Without break, execution falls through to the next case.
No, missing break statements are valid Java syntax. They enable intentional fall-through behavior, so the code compiles successfully.
Java Switch Expression Result Analysis
Switch expressions use the arrow (->) syntax and automatically terminate after the first match, unlike switch statements which require break to prevent fall-through.
No, break statements are not required in switch expressions. They are designed to return a value immediately upon matching a case.
Java Stream reduce with Identity vs Accumulator
In parallel streams, the accumulator is applied to partitions. Each partition starts with the identity, so 5 is added per partition before combining results.
Yes, addition is associative. However, using the identity argument incorrectly causes it to be added to each partition's initial state, inflating the total.
Java Parameter Shadowing and this Keyword
Because x++ modifies the local parameter variable, which shadows the instance variable. The instance variable is untouched.
It explicitly references the instance field of the current object, bypassing any local variable with the same name.
Java Collections.binarySearch Unsorted List Behavior
It returns 1 by coincidence because the element 'e3' is located at index 1 (the midpoint) of the array [e1, e3, e2]. This is undefined behavior and not guaranteed.
No. The Java documentation explicitly requires the list to be sorted in ascending order. Using it on an unsorted list produces undefined results.
Java Numeric Literals and Operators for 1Z0-829
String parsing methods do not accept underscore separators; they are only supported in source code numeric literals.
No, =+ is not a standard compound operator. It is likely a typo for += in the exam question text.
Java Bitwise and Logical Operators Result
The variable c is incremented via c++. It starts at -1 (from XOR), so the comparison uses -1, then c becomes 0. The printed value is the post-incremented c.
& always evaluates both operands. && short-circuits if the left operand is false. Here, the second line uses &&, but both sides were true anyway.
Java ZonedDateTime DST Offset Transition Logic
Because the transition back to standard time means the same local hour exists in two different UTC offsets. Advancing the instant moves you to the later occurrence.
It uses the Smarter Algorithm by default, preferring the earlier offset for ambiguous times unless specified otherwise, affecting how arithmetic operations resolve.
Java Reference Assignment and Null Handling
No. p = null only sets the variable p to null. p1 still holds a valid reference to the original object.
Because p1 = p makes both variables point to the same object instance in memory. Changes to the object are visible through any reference.