Key details for this exam, checked against the published exam outline
Each question shows the correct answer and an explanation of why it is right
Given:

Which two method invocation execute?
Given the code fragment:

What is the result?
The code fragment is using the Java SE 17 API to get the current time and then truncating it to minutes. The result will be the current time truncated to minutes, which is why option B is correct.Reference:
https://education.oracle.com/products/trackp_OCPJSE17
https://mylearn.oracle.com/ou/learning-path/java-se-17-developer/99487
https://docs.oracle.com/javase/17/docs/api/java.base/java/time/Instant.html#truncatedTo(java.time.temporal.TemporalUnit)
Given the code fragment:

What is the result?
The code fragment is creating a Duration object with a value of 5000 milliseconds, then printing it. Then, it is creating another Duration object with a value of 60 seconds, then printing it. Finally, it is creating a Period object with a value of 6 days, then printing it. The output will be ''PT5000PT60MP6D''.Reference: https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html, https://docs.oracle.com/javase/8/docs/api/java/time/Period.html
Given:

Which action enables the code to compile?
The answer is C because the code fragment contains a syntax error in line 7, where the method display is declared without any parameter type. This causes a compilation error, as Java requires the parameter type to be specified for each method parameter. To fix this error, the parameter type should be added before the parameter name, such as string design. This will enable the code to compile and run without any errors.Reference:
Oracle Certified Professional: Java SE 17 Developer
OCP Oracle Certified Professional Java SE 17 Developer Study Guide
Given the code fragment:

Which two statements at Line nl independently enable you to print 1250?
50 questions covering all exam domains, starting from $20
Exam domains verified against: Official Oracle 1Z0-829 exam guide, last checked September 2026.
Use primitives and wrapper classes including Math API, parentheses, type promotion, and casting to evaluate arithmetic and boolean expressions. Manipulate text including text blocks using String and StringBuilder classes, and manipulate date, time, duration, period, instant and time-zone objects using Date-Time API.
Sample question from this domain above: Q3
Create program flow control constructs including if/else, switch statements and expressions, loops, and break and continue statements.
Sample question from this domain above: Q1
Declare and instantiate Java objects including nested class objects and explain the object life-cycle. Create classes and records with instance and static fields, methods, constructors, and initializers. Implement inheritance, polymorphism, abstract and sealed classes, and use interfaces with private static and default methods.
Sample question from this domain above: Q4
Handle exceptions using try/catch/finally, try-with-resources, and multi-catch blocks including custom exceptions.
Create Java arrays, List, Set, Map, and Deque collections and add, remove, update, retrieve and sort their elements.
Use Java object and primitive streams including lambda expressions implementing functional interfaces to supply, filter, map, consume, and sort data. Perform decomposition, concatenation, reduction, grouping and partitioning on sequential and parallel streams.
Define modules and their dependencies exposing module content including for reflection. Define services, producers, and consumers. Compile Java code and produce modular and non-modular jars, runtime images, and implement migration using unnamed and automatic modules.
Create worker threads using Runnable and Callable and manage thread lifecycle including automations provided by different Executor services and concurrent API. Develop thread-safe code using different locking mechanisms and concurrent API. Process Java collections concurrently including parallel streams.
Read and write console and file data using I/O Streams. Serialize and de-serialize Java objects. Create, traverse, read, and write Path objects and their properties using java.nio.file API.
Create connections, create and execute basic, prepared and callable statements, process query results and control transactions using JDBC API.
Implement localization using locales, resource bundles, parse and format messages, dates, times, and numbers including currency and percentage values.
Common questions about the exam itself