ORACLE · 1Z0-829

Oracle 1Z0-829 Exam Practice Questions

130 questionsPDF by emailUpdated September 2026

US$39

Try 10 questions free

Card, Apple Pay or Google Pay. Your PDF is sent by email as soon as you check out.

Pass or your money backFail the exam after using this pack and we refund it. How the guarantee works
Category:
TRY BEFORE YOU BUY

Three of the 130 questions in this pack

Question 1

Given the code fragment:

and

Which is true?

Exhibit for question 1

  1. The program prints t1 : 1 : t2 : 1: t1 : 2 : t2 : 2 : in random order.
  2. The program prints t1 : 1 : t2 : 1: t1 : 2 : t2 : 2 :
  3. The program prints t1 : 1 : t2 : 1: t1 : 1 : t2 : 1 : indefinitely.
  4. The program prints an exception.
Show answer and explanation

Correct answer: A. The program prints t1 : 1 : t2 : 1: t1 : 2 : t2 : 2 : in random order.

random order. The code creates two threads that execute concurrently. Thread t1 increments the volatile variable x three times (printing x values 1, 2), while thread t2 increments the AtomicInteger xObj three times (printing values 1, 2). Since both threads run concurrently without synchronization between them, the interleaving of their print statements is non- deterministic. The actual values printed will always be in the pattern t1:1, t2:1, t1:2, t2:2, but the order in which these print statements execute is random due to thread scheduling. The volatile keyword on x and AtomicInteger's thread-safe operations ensure visibility, but do not enforce execution order between the two threads.

Why the other options are wrong

  • B. This ignores the non-deterministic nature of concurrent thread execution; the output order is not guaranteed to be sequential.
  • C. Both while loops terminate after their conditions are false (x < 3 and xObj.get() < 3), so the program does not print indefinitely.
  • D. The code is syntactically valid and contains no operations that would throw an exception; both threads execute their loops and exit normally.

Question 2

Which statement is true?

  1. IllegalStateException is thrown if a thread in waiting state is moved back to runnable.
  2. A thread in waiting state consumes CPU cycles.
  3. After the timed wait expires, the waited thread moves to the terminated state.
  4. A thread in waiting state must handle InterruptedException.
Show answer and explanation

Correct answer: D. A thread in waiting state must handle InterruptedException.

InterruptedException. When a thread is in a waiting state (such as after calling wait(), join(), or sleep()), it can be interrupted by another thread calling interrupt() on it. If interrupted while waiting, the thread must handle the InterruptedException that is thrown when it transitions out of the waiting state. This is a fundamental requirement in Java's threading model, methods that put threads into waiting states are declared to throw InterruptedException precisely because waiting threads must be prepared to handle interruption.

Why the other options are wrong

  • A. No exception is thrown simply for moving a waiting thread back to runnable; this is normal thread state transition when wait() completes or notify() is called.
  • B. A thread in waiting state does not consume CPU cycles; it relinquishes the CPU and remains idle until notified or interrupted.
  • C. After timed wait expires, a thread moves to the runnable state, not the terminated state; it must complete execution or be explicitly stopped to terminate.

Question 3

Daylight Saving Time (DST) is the practice of advancing clocks at the start of spring by one hour and adjusting them backward by one hour in autumn.

Considering that in 2021, DST in Chicago (Illinois) ended on November 7th at 2 AM, and given the fragment:

What is the output?

Exhibit for question 3

  1. true true
  2. false true
  3. true false
  4. false false
Show answer and explanation

Correct answer: C. true false

ZonedDateTime.of(2021-11-07, 01:30, America/Chicago) hits the overlap caused by the end of DST, and the rule for an ambiguous local time is to keep the earlier offset, so zdt is 01:30 CDT (UTC-5). plusHours(1) adds one hour of real elapsed time, which lands on 01:30 CST (UTC-6) because the clocks fall back at 02:00. Both objects therefore report hour 1, so the first comparison prints true, while the offsets -05:00 and -06:00 are not equal, so the second prints false.

Why the other options are wrong

  • A. The offsets differ across the fall-back transition, -05:00 before and -06:00 after, so the equals call on ZoneOffset returns false.
  • B. Adding one hour of elapsed time to 01:30 CDT produces 01:30 CST, so both getHour() calls return 1 and the first comparison is true.
  • D. The hour does not change during the overlap, since the local time repeats, making the first comparison true rather than false.

See all 10 free questions Get the full pack, US$39

130 practice questions for Oracle Java SE 17 Developer (1Z0-829), with full explanations.

Every question comes with the correct answer, the reasoning behind it, and a short note on why each wrong option is wrong. Work through it once with the answers, then again with the questions-only copy under exam conditions.

  • 130 questions mapped to the 1Z0-829 exam objectives
  • Answers and explanations for every question, including the wrong options
  • A questions-only PDF for timed practice runs
  • Instant delivery by email the moment you check out
  • Free monthly updates for as long as the exam is live
  • Pass or your money back

A failed 1Z0-829 attempt costs US$245. This pack is US$39, paid once.

Try 10 questions free before you buy.

Last updated September 2026 · 130 questions

What makes the 1Z0-829 hard

The Java 17 OCP is a code-reading exam. Fifty questions, and most of them are “what does this print”, with snippets built around the exact behaviours working developers gloss over.

The traps are precise language rules: sealed classes and records, switch expressions and pattern matching, streams and collectors edge cases, generics bounds, module declarations, and the classic minefields of operator promotion, string immutability, and exactly when finally does not run. IDE-assisted developers fail it because the exam removes the IDE and keeps the ambiguity.

Java certification remains one of the most searched developer credentials, and 17 is the LTS version employers name.

About the exam

1Z0-829 certifies Java SE 17 development and awards the Oracle Certified Professional: Java SE 17 Developer credential, covering language fundamentals through advanced features including records, sealed classes, streams, concurrency and modules. Does not expire.

Exam topics

  • Object-oriented Java: classes, records, sealed types, generics
  • Control flow, switch expressions and pattern matching
  • Streams, lambdas and collections
  • Concurrency and the module system
  • Exceptions, I/O, JDBC and localisation

50 questions, 90 minutes, passing score 68%, US$245 per attempt, at a Pearson VUE centre or online proctored, does not expire.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Questions before you buy

What do I get when I buy the Oracle 1Z0-829 pack?

130 practice questions as a PDF, each with the correct answer, a full explanation and a note on why the other options are wrong, plus a separate questions-only PDF for timed practice.

How quickly do I receive it?

Your PDF is prepared and sent to your email address after checkout, and you get a confirmation as soon as it is on its way.

Is there a free sample?

Yes. Ten questions from this pack, with answers and explanations, are free on this page and as a PDF, so you can judge the quality before you pay.

Are updates included?

Yes. The pack is updated every month for as long as the exam is live, and updates are free for everyone who has bought it.

What if I fail the exam?

We refund the pack. Sit the exam 7 to 30 days after buying, then send your official score report within 7 days of the exam date, as set out in the refund policy.

Can I share it with colleagues?

Each purchase is licensed to one person. For a team, school or training organisation, email support@certstash.com for a licence that fits.