PracticeVideosBlogFlashcards
All Practice Exams

Free Practice Questions for Java SE 17 (1Z0-829)

Exam-style questions and explanations by OpenExamPrep.

✓ No registration✓ No credit card
100+ Questions
100% Free
Exam Review

Key Facts: Java SE 17 (1Z0-829) Exam

50

Exam Questions

Oracle MyLearn exam page

90 min

Time Limit

Oracle MyLearn exam page

68%

Passing Score

Oracle MyLearn exam page

$245

Exam Fee (USD)

Oracle MyLearn FAQ

Java SE 17

LTS Anchor

Oracle MyLearn exam page

Feb 28, 2027

Exam Retirement

Oracle MyLearn

1Z0-829 contains 50 multiple-choice questions delivered over 90 minutes with a 68% passing score; an Oracle exam attempt costs US$245, and Oracle delivers the exam as an online-proctored session through MyLearn. Oracle has announced that 1Z0-829 retires on February 28, 2027. The exam covers Java SE 17 standard features (records, sealed classes, pattern matching for instanceof, text blocks, switch expressions); pattern matching for switch is only a preview feature in Java 17.

Sample Java SE 17 (1Z0-829) Practice Questions

Try these sample questions to review concepts for the Java SE 17 (1Z0-829) exam. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1Which statement about Java's `var` local-variable type inference (introduced in SE 10) is true in Java SE 17?
A.`var` can be used as a class field type
B.`var x = null;` is a valid declaration
C.`var` infers the type at compile time and can only be used for local variables, indexes in for-loops, and try-with-resources
D.`var` is a reserved Java keyword and cannot be used as a variable name
Explanation: `var` is a reserved type name (not a keyword) that triggers local-variable type inference. The compiler infers the static type from the initializer at compile time. It is restricted to local variables with initializers, enhanced/standard for-loop indexes, and try-with-resources resource declarations.
2Given: ``` int a = 5; int b = 2; double c = a / b; System.out.println(c); ``` What is printed?
A.2.5
B.2.0
C.2
D.Compilation error
Explanation: `a / b` is integer division because both operands are `int`, producing 2. The result is then widened to `double` when assigned to `c`, so `2.0` is printed.
3What is the value of `s.length()` after `String s = "caf\u00e9";`?
A.3
B.4
C.5
D.Compilation error
Explanation: `\u00e9` is a Unicode escape for the single character e-acute. The string contains the four characters c, a, f, e-acute, all of which fit in a single `char` (UTF-16 code unit), so `length()` returns 4.
4Which `String` method introduced before Java 17 returns `true` only when the string is empty or contains only whitespace characters as defined by `Character.isWhitespace`?
A.`isEmpty()`
B.`isBlank()`
C.`strip().isEmpty()` is the only valid approach
D.`trim().equals("")`
Explanation: `String.isBlank()` (added in Java 11) returns `true` when the string is empty or every character is a Unicode whitespace as defined by `Character.isWhitespace(int)`. It is preferred over `trim().isEmpty()` for Unicode-aware whitespace.
5Given the text block: ``` String s = """ hello world """; ``` What is the value of `s` (using `<NL>` to represent a newline)?
A.`hello<NL> world<NL>`
B.` hello<NL> world<NL> `
C.`hello world`
D.Compilation error: text blocks must use double quotes
Explanation: Text blocks (finalized in Java 15) strip incidental leading whitespace based on the indentation of the closing delimiter. Since the closing `"""` is indented by four spaces, four leading spaces are removed from each content line, leaving `hello`, then two extra spaces before `world`. Each content line ends with `\n`.
6Which declaration of a Java 17 record is valid?
A.`record Point(int x, int y) { int z; }`
B.`record Point(int x, int y) { public Point { if (x < 0) throw new IllegalArgumentException(); } }`
C.`abstract record Point(int x, int y) {}`
D.`record Point extends Number(int x, int y) {}`
Explanation: A record may declare a compact canonical constructor (no parameter list, no `this.x =` assignments) for validation/normalization. The header components are implicitly final fields and the compiler generates accessors, `equals`, `hashCode`, and `toString`.
7Which statement about sealed classes (finalized in Java 17) is correct?
A.Subclasses listed in `permits` must declare themselves `final`, `sealed`, or `non-sealed`
B.A sealed class may have any subclass as long as it is in the same module
C.`permits` is optional even when subclasses are in a different package
D.Sealed interfaces are not allowed; only sealed classes are
Explanation: Every direct subclass of a sealed class or interface must be `final`, `sealed`, or `non-sealed`, and must be listed in the `permits` clause. This locks down the subclass hierarchy at compile time.
8Given: ``` Object o = "hello"; if (o instanceof String s) { System.out.println(s.length()); } ``` Which statement is true under Java 17 standard features?
A.Compilation fails because `instanceof` cannot bind a variable
B.Pattern matching for `instanceof` is a final feature in Java 16+; the code prints 5
C.Pattern matching for `instanceof` is still preview in Java 17 and requires `--enable-preview`
D.The variable `s` is in scope after the `if` block as well
Explanation: Pattern matching for `instanceof` was finalized in Java 16 and is a standard feature in Java 17. When the pattern matches, the compiler binds `s` to the narrowed type for the true branch's flow scope, so `s.length()` returns 5.
9Given the switch expression: ``` int day = 3; String name = switch (day) { case 1, 7 -> "weekend"; case 2, 3, 4, 5, 6 -> "weekday"; default -> "unknown"; }; ``` Which statement is true?
A.Switch expressions require a `break` after each case
B.Each case label must list exactly one constant
C.The expression assigns `"weekday"` to `name` because case `3` matches with arrow form (no fall-through)
D.Compilation fails because `default` is mandatory only in switch statements, not switch expressions
Explanation: Arrow-form switch expressions, finalized in Java 14, do not fall through and may list multiple constants per label. With `day == 3`, the second case matches and `name` becomes `"weekday"`.
10Which `for` loop will throw a `ConcurrentModificationException` when executed?
A.Iterating a `List` with an explicit `Iterator` and calling `iterator.remove()`
B.Using `List.removeIf(predicate)` on an `ArrayList`
C.Iterating an `ArrayList` with an enhanced `for` loop and calling `list.remove(item)` inside the loop
D.Iterating a `CopyOnWriteArrayList` with an enhanced `for` loop and adding elements via the list
Explanation: Modifying an `ArrayList` directly while iterating with the enhanced `for` loop triggers the iterator's fail-fast check and throws `ConcurrentModificationException` on the next iteration.

About the Java SE 17 (1Z0-829) Exam

1Z0-829 is the Oracle Certified Professional exam for Java SE 17 LTS. It validates competency across Java fundamentals, modern language features (records, sealed classes, pattern matching for instanceof, text blocks, switch expressions), generics, the Stream and Date/Time APIs, NIO.2, JDBC, the module system (JPMS), concurrency, and localization.

Exam sponsor: Oracle University (online proctored through Oracle MyLearn). The requirements and fees below concern the certification or admission exam, separate from our free practice resources.

Questions

50 questions

Time Limit

90 minutes

Passing Score

68%

Exam / Certification Fees

$245 USD

Exam sponsor website

Reported exam pass rate: Not published. Oracle does not release official 1Z0-829 pass rates Exam sponsor website

Fees, eligibility, and exam policies can change. Confirm them with the exam sponsor before applying or paying.

Our practice resources: topics covered

We aim to reflect publicly available exam outlines and topic information in our study resources. Coverage, format, and difficulty may differ from the actual exam, and we cannot guarantee that every detail is accurate or current. Confirm exam requirements, fees, and policies with the official exam sponsor.

Not published

Handling date, time, text, numeric and boolean values

Primitives and wrapper classes with the Math API, parentheses, type promotion and casting; String, StringBuilder and text blocks; date, time, duration, period, instant and time-zone objects.

Not published

Controlling Program Flow

if/else, switch statements and expressions, loops, and break and continue statements.

Not published

Utilizing Java Object-Oriented Approach

Objects and nested classes, object life cycle and garbage collection, classes and records, overloading with varargs, scope, var, encapsulation and immutability, inheritance with abstract and sealed classes, overriding, polymorphism, casting, instanceof and pattern matching, interfaces, functional interfaces, and enums.

Not published

Handling Exceptions

try/catch/finally, try-with-resources, multi-catch blocks, and custom exceptions.

Not published

Working with Arrays and Collections

Arrays, List, Set, Map and Deque collections: add, remove, update, retrieve and sort elements.

Not published

Working with Streams and Lambda expressions

Object and primitive streams with lambdas implementing functional interfaces; decomposition, concatenation, reduction, grouping and partitioning on sequential and parallel streams.

Not published

Packaging and deploying Java code and use the Java Platform Module System

Modules and dependencies, exposing content including for reflection, services; compiling, modular and non-modular JARs, runtime images, and migration with unnamed and automatic modules.

Not published

Managing concurrent code execution

Runnable and Callable worker threads, thread life cycle and executor services; thread-safe code with locking and the concurrent API; processing collections concurrently, including parallel streams.

Not published

Using Java I/O API

Console and file data with I/O streams, object serialization, and Path objects with the java.nio.file API.

Not published

Accessing databases using JDBC

Connections, basic, prepared and callable statements, query results, and transaction control.

Not published

Implementing Localization

Locales, resource bundles, and parsing and formatting messages, dates, times, numbers, currency and percentages.

Preparing for the Java SE 17 (1Z0-829) Exam

What You Need to Know

  • Passing score: 68%
  • Exam length: 50 questions
  • Time limit: 90 minutes
  • Exam / certification fees: $245 USD Official sources

Using Our Practice Resources

  • Work through all 100 available questions
  • Review every answer and explanation
  • Track weak areas and revisit them
  • Use our AI tutor for tough concepts

Java SE 17 (1Z0-829): Suggested Study Strategy

1Practice writing records, sealed classes, and switch expressions until the syntax is automatic; many questions hinge on small grammar details.
2Master the Stream API end to end: intermediate vs terminal operations, short-circuit semantics, primitive specializations, Collectors, and parallel-stream pitfalls.
3Drill the Date/Time API including DST behavior in ZonedDateTime and the difference between Duration and Period.
4Trace concurrency questions step by step: visibility (volatile), atomicity (AtomicInteger), happens-before, and ExecutorService lifecycle.
5Learn module-info syntax: requires, requires transitive, exports (qualified vs unqualified), opens, uses, and provides...with.

Frequently Asked Questions

What is the format of the Oracle 1Z0-829 exam?

1Z0-829 has 50 multiple-choice questions delivered over 90 minutes with a 68% passing score. Oracle delivers it directly as an online-proctored exam that you book and take through Oracle MyLearn; Pearson VUE delivers only the Chinese and Japanese language versions.

How much does the Java SE 17 Developer (1Z0-829) exam cost?

Oracle's MyLearn certification FAQ values an exam attempt at US$245, and each attempt, including a retake, uses a new exam attempt. Some Oracle learning subscriptions include exam attempts.

Which Java 17 language features are tested?

1Z0-829 covers records (finalized in Java 16), sealed classes (finalized in Java 17), pattern matching for instanceof (finalized in Java 16), text blocks (finalized in Java 15), and switch expressions (finalized in Java 14). Pattern matching for switch was only a preview feature in Java 17, so it is not part of standard Java 17 code.

Does the certification expire?

Oracle's recertification policy lists expiry periods for Oracle Cloud Infrastructure (24 months), Oracle Cloud Applications (18 months), and certain Database credentials; Java SE credentials are not on that list. The credential is tied to Java SE 17, and the 1Z0-829 exam itself retires on February 28, 2027.

What is the recommended preparation time?

Most candidates report 80-150 hours over 8-14 weeks: refresh fundamentals, drill the modern language features (records, sealed classes, pattern matching), then focus on streams, concurrency, modules, and JDBC.

How does 1Z0-829 differ from 1Z0-830 (Java SE 21)?

1Z0-830 covers Java SE 21 and adds final pattern matching for switch, virtual threads, and sequenced collections. 1Z0-829 is anchored on Java SE 17 LTS features only and treats those Java 21 additions as out of scope.

When does the 1Z0-829 exam retire?

Oracle's MyLearn exam page states that the Java SE 17 Developer (1Z0-829) exam retires on February 28, 2027. Candidates who want this credential should schedule the exam before that date; Java SE 21 Developer (1Z0-830) is Oracle's exam for the later Java LTS release.

What is the retake policy for 1Z0-829?

Oracle's Certification Program Guidelines let you schedule a retake of a failed exam with a new exam attempt, and you cannot retake an exam you have passed. Oracle provides no free retake, and the guidelines page does not state a minimum waiting period.