Overview
Domain 1 covers the values every Java program manipulates. Oracle groups three objectives here: using primitives and wrapper classes while evaluating expressions with precedence, promotion, casting and the Math API; manipulating text with String, StringBuilder and text blocks; and working with LocalDate, LocalDateTime, ZonedDateTime, Instant, Duration and Period, including what happens at daylight saving transitions. Most items are short code fragments where you predict output or spot a compile error.
Exam status as of October 2026: 1Z0-830 remains listed by Oracle training partners, and we found no Oracle retirement notice for it. Secondary sources also list a newer Java SE 25 Developer Professional exam (1Z0-831), so confirm in the Oracle University catalog which version you are booking before you study.
How it's tested
Questions in this section are almost always code-reading items. You see five to fifteen lines and choose the printed output, or pick the line that fails to compile. Several options look plausible because they reflect a habit from another language or from an older Java version.
-
Predict the printed value
A sequence of arithmetic, casting or String operations runs and you choose the exact output, including spacing and decimal places.
-
Spot the compile error
One line assigns an int result to a byte, calls a missing method or misuses a text block delimiter, and you identify which line fails.
-
Immutable result ignored
A call such as concat, plusDays or toUpperCase is made without assigning the result, and you must notice the original object never changed.
A snippet declares byte b = 10 and then writes b = b + 1. Many candidates expect 11. The right side is promoted to int because arithmetic on byte, short and char always produces at least an int, so assigning it back to a byte without a cast is a compile error. Writing b += 1 would compile, because compound assignment includes an implicit narrowing cast.
Objectives 3
Official objectives from the Oracle outline, in outline order.
1.1 Use primitives and wrapper classes. Evaluate arithmetic and boolean expressions, using the Math API and by applying precedence rules, type conversions, and casting.Primitive types, wrappers, operators, promotion, casting and java.lang.Math.
- What it means
- You must know the eight primitive types, their sizes and default values, and how each maps to a wrapper such as Integer or Character. Expressions follow precedence and associativity rules, numeric promotion widens operands before arithmetic, and casting narrows values explicitly. Autoboxing and unboxing convert between primitives and wrappers automatically.
- What to understand
- Learn binary numeric promotion: if either operand is double the result is double, else float, else long, else int. Integer division truncates, and the remainder sign follows the left operand. Pre-increment and post-increment differ in the value the expression yields. Short-circuit operators && and || may skip the right side, while & and | always evaluate both. Know Math.round (returns long for double), Math.ceil, Math.floor, Math.max, Math.abs and Math.pow. Integer.valueOf caches values from -128 to 127, so == on boxed values can be true or false depending on the number. Unboxing a null wrapper throws NullPointerException.
- How it shows up
- Expect expressions mixing ++, compound assignment and casts, plus questions on wrapper equality and overflow when a value exceeds int range.
- Common confusion
- Believing compound assignment and plain assignment behave the same; only += and similar operators insert an implicit cast.
1.2 Manipulate text, including text blocks, using String and StringBuilder classes.String immutability, common String and StringBuilder methods, and text block rules.
- What it means
- String objects are immutable, so every modifying method returns a new String. StringBuilder is a mutable sequence whose methods change the same object and usually return it for chaining. Text blocks, opened with three double quotes followed by a line break, let you write multi-line strings without escape-heavy concatenation.
- What to understand
- Know substring (end index exclusive), indexOf, charAt, replace, strip versus trim, isBlank versus isEmpty, repeat, indent, lines, formatted and equalsIgnoreCase. With StringBuilder, learn append, insert, delete, deleteCharAt, reverse, replace and setLength, and remember it does not override equals. String literals are interned in the pool, so two equal literals can be == while a String built at runtime is a different object. In a text block, incidental indentation is removed based on the least-indented line including the closing delimiter, trailing spaces are stripped, a backslash at line end joins lines and \s keeps a space.
- How it shows up
- Expect chained StringBuilder calls, == versus equals comparisons, and text blocks whose output depends on where the closing delimiter sits.
- Common confusion
- Assuming that calling toUpperCase or concat on a String changes it when the result is not assigned.
1.3 Manipulate date, time, duration, period, instant and time-zone objects including daylight saving time using Date-Time API.LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Instant, Period, Duration and DST behaviour.
- What it means
- The java.time package models dates and times with immutable classes. LocalDate, LocalTime and LocalDateTime carry no zone, ZonedDateTime adds a ZoneId and its rules, and Instant is a point on the UTC timeline. Period measures date-based amounts in years, months and days, while Duration measures time-based amounts in seconds and nanoseconds.
- What to understand
- Every plus or with method returns a new object, so ignoring the return value leaves the original unchanged. Months are numbered from 1, and adding a month to January 31 clamps to the last valid day of February. Period prints as P1Y2M3D and Duration as PT2H30M. Adding a Duration to a LocalDate throws UnsupportedTemporalTypeException because a date has no time fields. At a spring-forward transition a ZonedDateTime inside the missing hour shifts forward, and Duration.between across the transition counts real elapsed time. Know DateTimeFormatter patterns: MM is month, mm is minute, and HH is the 24-hour clock.
- How it shows up
- Look for a date method called without assignment, month-end arithmetic, and elapsed-time calculations that cross a daylight saving change.
- Common confusion
- Mixing up Period and Duration, or expecting a LocalDateTime to adjust itself for daylight saving.
High-yield concepts
The terms, rules and formulas this domain turns into questions most often.
-
Numeric promotion
Smaller integer types become int before arithmetic.
- Remember
- byte + byte is an int.
- Tested as
- Compile-error questions on assignments.
- Trap
- Assigning the result to a byte without a cast.
-
Compound assignment cast
Operators such as += include an implicit narrowing cast.
- Remember
- short s = 1; s += 5 compiles.
- Tested as
- Comparing s = s + 5 with s += 5.
- Trap
- Thinking both forms fail or both compile.
-
Integer cache
Integer.valueOf reuses objects for -128 to 127.
- Remember
- Use equals to compare wrapper values.
- Tested as
- Wrapper equality output questions.
- Trap
- Trusting == on boxed numbers above 127.
-
Short-circuit evaluation
&& and || skip the right operand when the result is known.
- Remember
- Side effects on the right may not run.
- Tested as
- Predicting a counter after a condition.
- Trap
- Treating & like && for evaluation order.
-
String immutability
String methods return new objects.
- Remember
- Unassigned results are lost.
- Tested as
- Output questions after method calls.
- Trap
- Expecting the original reference to change.
-
StringBuilder mutability
Builder methods change one shared object.
- Remember
- Two references to one builder see every change.
- Tested as
- Chained append and insert output.
- Trap
- Comparing builders with equals and expecting content comparison.
-
Text block indentation
Common leading whitespace is stripped.
- Remember
- The closing delimiter position counts toward indentation.
- Tested as
- Predicting exact text block output.
- Trap
- Ignoring the closing delimiter column.
-
Period versus Duration
Period is date-based and Duration is time-based.
- Remember
- Period prints P..., Duration prints PT....
- Tested as
- Choosing the right amount type.
- Trap
- Adding a Duration to a LocalDate.
-
ZonedDateTime and DST
Zone rules adjust local times at transitions.
- Remember
- A time in the spring gap moves forward.
- Tested as
- Elapsed-time questions in US or EU zones.
- Trap
- Assuming every day has 24 hours.
-
Instant
A moment on the UTC timeline without a zone.
- Remember
- Use it for timestamps and machine time.
- Tested as
- Conversions between zones.
- Trap
- Treating it as a local time.
Side by side
Concepts candidates mix up, compared on the point that decides the answer.
Text types
| Concept | Meaning | Key difference | Common trap |
|---|---|---|---|
| String | Immutable character sequence | Methods return new objects; literals are pooled | Calling a method without assigning the result |
| StringBuilder | Mutable character sequence | Methods modify and return the same object | Expecting equals to compare contents |
| Text block | Multi-line String literal | Strips incidental indentation and trailing spaces | Placing text on the opening delimiter line |
Date-Time amounts and points
| Concept | Meaning | Key difference | Common trap |
|---|---|---|---|
| LocalDateTime | Date and time with no zone | Cannot represent DST rules | Using it to compute real elapsed time |
| ZonedDateTime | Date-time with a ZoneId | Applies offset changes at DST | Ignoring the skipped or repeated hour |
| Period | Years, months and days | Calendar-based; works with dates | Applying it to LocalTime |
| Duration | Seconds and nanoseconds | Clock-based; works with times and instants | Applying it to LocalDate |
Exam traps
Each trap is an answer that looks right. Learn the clue that should change your mind.
-
Boxed equality
- What candidates pick
- Says two Integer objects holding 200 are == equal.
- Why it looks right
- Smaller values in many examples compare true.
- Why it's wrong
- The cache covers only -128 to 127, so two boxed 200 values are separate objects and == is false.
Clue to watch for A boxed value above 127 compared with ==.
-
Lost immutable result
- What candidates pick
- Picks output that shows the modified date or string.
- Why it looks right
- The method name suggests the object changed.
- Why it's wrong
- String and java.time types are immutable; the change exists only in the returned object, which the code discarded.
Clue to watch for A method call on its own line with no assignment.
-
Text block margin
- What candidates pick
- Chooses output with the original source indentation.
- Why it looks right
- The code looks indented in the editor.
- Why it's wrong
- The compiler removes the common indentation, and the closing delimiter's column sets that margin.
Clue to watch for The closing triple quote is placed further left than the content.
-
Month-end overflow
- What candidates pick
- Expects an exception or March 3 when adding a month to January 31.
- Why it looks right
- February has fewer days, so something seems wrong.
- Why it's wrong
- plusMonths clamps to the last valid day of the target month rather than overflowing or failing.
Clue to watch for A date at the end of a long month.
-
Every day is 24 hours
- What candidates pick
- Computes a 24-hour Duration across a spring-forward date.
- Why it looks right
- A calendar day normally has 24 hours.
- Why it's wrong
- With a ZonedDateTime in a DST zone the transition day is 23 hours long, and Duration.between reports real elapsed time.
Clue to watch for A ZoneId such as America/New_York and a March or November date.
Answer framework
Use these checks in order when a snippet mixes values, text and dates.
- Identify the declared type of every variable, because promotion to int, long or double decides whether assignments compile.
- Evaluate operators by precedence, tracking pre-increment and post-increment values and noting where && or || skips the right operand.
- For each String or java.time call, ask whether the result is assigned; immutable types change nothing unless the new object is kept.
- For StringBuilder, follow the single mutable object through every chained call and track index positions after each insert or delete.
- For dates and times, decide whether a zone is involved, whether the amount is a Period or Duration, and whether month-end clamping or a DST gap applies.
Practice question
Want more like this? The 1Z0-830 practice test has questions for every domain.
Checklist
0 of 11
Tick each one you can do without notes. Your ticks stay in this browser.
Study strategy
Start with a scratch project on JDK 21 and type every rule as a tiny program. Write a class that prints the results of mixed arithmetic, boxed comparisons and casts, then change one type at a time and predict the output before running it. This builds the instinct the exam needs, because nearly all items here are fragments you must evaluate by hand.
Spend a second session on text. Build a StringBuilder, chain insert, delete and reverse calls, and check the result after each step. Write four text blocks that differ only in where the closing delimiter sits and compare the output.
Use a third session for java.time. Create dates at month end, add months, and print the results. Create a ZonedDateTime in America/New_York at 1:30 a.m. on a spring-forward Sunday, add one hour, and observe the offset change. Finish with a one-page summary of promotion rules, String versus StringBuilder behaviour and Period versus Duration, then answer timed practice items without a compiler.
FAQ
How much of 1Z0-830 is Domain 1, Handling Date, Time, Text, Numeric and Boolean Values?
Oracle does not publish section weights for 1Z0-830. We plan for about six of the 50 questions, but the rules here also appear inside snippets from every other section.
Do I need to memorise every String method?
No, but you should know the common ones well: substring, indexOf, charAt, replace, strip, trim, isBlank, repeat, lines and formatted, plus their exact return values.
Is the old java.util.Date class on the exam?
The objective names the Date-Time API, which means the java.time package. Focus on LocalDate, LocalDateTime, ZonedDateTime, Instant, Period, Duration and DateTimeFormatter.
Which time zones should I practise daylight saving with?
Practise with America/New_York and Europe/London or Europe/Paris, since their spring and autumn transitions are well documented and easy to test with ZonedDateTime.
Are text blocks a preview feature in Java 21?
No. Text blocks became a standard feature in Java 15, so they are fully supported on Java 21 and fair game for this exam.
Is 1Z0-830 being replaced by a Java SE 25 exam?
Secondary sources list a Java SE 25 Developer Professional exam, 1Z0-831. We found no Oracle retirement date for 1Z0-830, so check the Oracle University catalog before booking.
Test your Domain 1 knowledge
You have reviewed promotion and casting, wrapper equality, String and StringBuilder behaviour, text blocks and the Date-Time API. Check whether you can predict output without running the code.
Keep going
- Training Training Built on your Weak areas
- Practice test Questions by domain, with explanations
- Mock exam Full length, timed like the real exam
- Readiness test Find your weakest domain in minutes
- Cheat sheet Key terms and formulas on one page
- Ask the 1Z0-830 AI tutor Get any concept explained your way