Oracle · 1Z0-829
Validates expertise in Java SE 17 programming, covering core language features, object-oriented design, functional programming with streams and lambdas, concurrency, JDBC, and the Java Platform Module System. Targets experienced Java developers seeking professional-level certification.
Practice Questions
598
≈ 9 practice exams
Duration
90 minutes
Passing Score
68%
Difficulty
ProfessionalLast Updated
Aug 2026
Use this 1Z0-829 practice exam to prepare for Oracle Certified Professional: Java SE 17 Developer (1Z0-829) with realistic questions, detailed explanations, and focused study modes. The practice bank includes 598 questions for Oracle 1Z0-829, so you can review the exam steadily instead of relying on one long cram session.
As you practice, pay extra attention to recurring topics such as Handling Date, Time, Text, Numeric and Boolean Values, Controlling Program Flow, Utilizing Java Object-Oriented Approach, Handling Exceptions, and Working with Arrays and Collections. Start with short sessions to identify weak areas, then move into timed quizzes once your accuracy is consistent.
The explanations are written for candidates preparing for Oracle certification questions and reviewing how the concepts apply in practice. Use the free preview first, then unlock the full question bank when you are ready to build a complete study routine.
5 sample questions with answers and explanations. The full bank has 598 questions, enough for 9 full-length practice exams.
Preview — answers shown1. Which class is the direct superclass of RuntimeException in the Java exception hierarchy? (Select one!)
Explanation
RuntimeException directly extends Exception, which is why all RuntimeException subclasses are unchecked exceptions that do not need to be declared in a throws clause or explicitly caught. Throwable is the superclass of Exception itself, two levels above RuntimeException, not its direct parent. Error is a sibling of Exception under Throwable and is unrelated to the RuntimeException branch. Object is the root of the entire class hierarchy, far above Throwable.
2. A developer at Adatum writes the following code: System.out.println(Math.round(-1.5f)); System.out.println(Math.round(-2.5f)); What is the output? (Select one!)
Explanation
Math.round() applies the half-up rounding rule, which rounds toward positive infinity when the fractional part is exactly 0.5. For Math.round(-1.5f), the two nearest integers are -2 and -1. Because the rule favors the direction of positive infinity, -1 is returned rather than -2. For Math.round(-2.5f), the nearest integers are -3 and -2, and rounding toward positive infinity yields -2. Math.round(float) returns an int, and Math.round(double) returns a long. This behavior differs from the intuitive round-half-away-from-zero convention that many developers expect, which would produce -2 and -3 respectively.
3. A developer at Contoso is implementing a financial rounding utility and needs to predict the return value of Math.round(-1.5f). What does this expression evaluate to? (Select one!)
Explanation
Math.round() applies the round-half-up rule, which rounds the midpoint case toward positive infinity rather than away from zero. For -1.5f, the two nearest integers are -2 and -1. Since -1 is in the positive direction from -1.5, the method returns -1. This surprises many developers who expect symmetric rounding where -1.5 would round to -2 to mirror the behavior of 1.5 rounding to 2. The Math.round rule is consistent: for any x.5 value, the result is always the higher (more positive) integer. The return type of Math.round(float) is int, while the overload Math.round(double) returns a long. Developers requiring symmetric or decimal-precise rounding should use BigDecimal with an explicit RoundingMode.
4. A developer at Contoso writes the following code: System.out.println(Math.round(-0.5f)); System.out.println(Math.round(-1.5)); What is the output? (Select one!)
Explanation
Math.round is specified as Math.floor(x + 0.5), which rounds toward positive infinity for half-values rather than away from zero. For Math.round(-0.5f): Math.floor(-0.5 + 0.5) = Math.floor(0.0) = 0, returned as int. For Math.round(-1.5): Math.floor(-1.5 + 0.5) = Math.floor(-1.0) = -1, returned as long. The output is 0 followed by -1. Applying symmetric half-away-from-zero logic would incorrectly produce -1 and -2 respectively, but Java's Math.round consistently biases toward positive infinity for exact half-values. The return types also differ: Math.round(float) returns int, while Math.round(double) returns long.
5. A developer at Litware writes the following binary search code: int[] data = {3, 7, 11, 15, 22}; int result = Arrays.binarySearch(data, 9); System.out.println(result); What is printed? (Select one!)
Explanation
Arrays.binarySearch returns a non-negative index when the target is found in the sorted array. When the target is absent, it returns a negative value computed as the bitwise complement of the insertion point, which is equivalent to -(insertion point) - 1. The insertion point is the index at which the target would need to be inserted to maintain sorted order. In the array {3, 7, 11, 15, 22}, the value 9 falls between 7 at index 1 and 11 at index 2. Inserting 9 to preserve ascending order would place it at index 2, so the insertion point is 2. Applying the formula gives -(2) - 1 which equals -3. This encoding ensures that not-found return values never collide with valid found indices, since a successful find always returns a value zero or greater. The array must be fully sorted in ascending order before calling binarySearch; passing an unsorted array produces undefined, unpredictable results.
$17.99
One-time access to this exam