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. A developer at Tailspin writes the following overloaded class: class Demo { static void show(long x) { System.out.println("long"); } static void show(Integer x) { System.out.println("Integer"); } static void show(Object x) { System.out.println("Object"); } public static void main(String[] args) { int value = 42; show(value); } } What is printed? (Select one!)
Explanation
Java resolves overloaded methods in three distinct passes, choosing the most specific applicable method found in the earliest pass. In the first pass the compiler looks for a method that accepts int without any conversion and finds none. In the second pass the compiler applies widening primitive conversions: int widens to long, so show(long) becomes applicable and is selected. The compiler never reaches the third pass, which would consider autoboxing. If it did, int would box to Integer and match show(Integer). Because widening primitive conversion is tried before autoboxing, show(long) is selected and long is printed. This ordering ensures that adding a boxing overload to existing code does not silently change which method is called. Promotion all the way to Object would only occur if neither widening nor boxing produced a match, which does not happen here since widening to long succeeds.
2. A developer at Contoso writes the following code involving an enum: enum Priority { LOW, MEDIUM, HIGH, CRITICAL } public class Main { public static void main(String[] args) { Priority p = Priority.valueOf("HIGH"); System.out.println(p.ordinal() + "-" + p.name()); } } What does this code print? (Select one!)
Explanation
Enum constants are assigned 0-based ordinal values in their declaration order. In the Priority enum, LOW has ordinal 0, MEDIUM has ordinal 1, HIGH has ordinal 2, and CRITICAL has ordinal 3. The valueOf("HIGH") method performs a case-sensitive name lookup and returns the HIGH constant without error. Calling ordinal() on HIGH returns 2, and name() returns the constant's declared identifier as a String, which is HIGH. The output is therefore 2-HIGH. If the string argument to valueOf() did not exactly match any declared constant name (including case), an IllegalArgumentException would be thrown at runtime.
3. A developer at Litware writes the following code: Number[] numbers = new Integer[3]; numbers[0] = Integer.valueOf(42); // Line A numbers[1] = Double.valueOf(3.14); // Line B numbers[2] = Long.valueOf(100L); // Line C What is the result? (Select one!)
Explanation
Java arrays are covariant: assigning an Integer[] to a Number[] reference compiles without error because Integer is a subtype of Number. At runtime, however, the JVM enforces the actual underlying array type on every store operation, not the declared reference type. The underlying array is Integer[], so only Integer values can be stored. Line A stores Integer.valueOf(42) into an Integer[] slot, which succeeds. Line B attempts to store a Double value into an Integer[] slot; the JVM detects this type mismatch and throws ArrayStoreException immediately, before the assignment completes. Line C is never reached. This is the fundamental trade-off of array covariance: compile-time flexibility at the cost of runtime type checks on every array write, enforced through the ArrayStoreException mechanism.
4. A developer at Litware writes the following code: Integer x = 100; Integer y = 100; Integer p = 200; Integer q = 200; System.out.println(x == y); System.out.println(p == q); What is the output? (Select one!)
Explanation
Integer autoboxing uses Integer.valueOf() internally, which caches instances for values in the range -128 to 127. For x and y both assigned 100, both variables reference the same cached Integer object, so the == operator compares identical references and returns true. For p and q both assigned 200, the value 200 falls outside the cache range, causing two distinct Integer objects to be allocated on the heap. The == operator compares object references, not values, and returns false because the two objects reside at different memory addresses. To compare Integer values for equality regardless of caching, always use .equals() rather than ==.
5. A developer at Adatum writes the following code and wants to predict what it prints: static int calculate() { try { System.out.print("try "); return 10; } finally { System.out.print("finally "); return 30; } } public static void main(String[] args) { System.out.println(calculate()); } What is the output? (Select one!)
Explanation
When control reaches the return statement in the try block, Java saves the pending return value of 10 and transfers control to the finally block before the method actually returns. The finally block prints "finally " and then executes its own return statement, which completely discards the saved value of 10 and causes the method to return 30 instead. A return statement inside a finally block overrides any return value that was pending from the try or catch block. The try block executes first and prints "try " before the return is intercepted. Since no exception is thrown, the catch block is skipped entirely. The output is therefore the text "try finally " followed by 30 on a new line produced by the println call in main.
$17.99
One-time access to this exam