1Z0-829 — Oracle Java SE 17 Developer Quick Review
Quick Review for Oracle Java SE 17 Developer (1Z0-829) candidates: high-yield Java SE 17 concepts, common traps, and practice focus.
Quick Review purpose
This Quick Review is for candidates preparing for Oracle’s Oracle Java SE 17 Developer (1Z0-829) exam. Use it to refresh the concepts most likely to matter before moving into topic drills, mock exams, and detailed explanations in an IT Mastery question bank.
This page is IT Mastery review support. It is not affiliated with Oracle and does not replace Oracle’s official exam information.
How to use this review
- Scan the tables first. Mark anything you cannot explain without looking it up.
- Run topic drills immediately after each weak area. Java exam misses often come from small compile-time or runtime details.
- Practice with code mentally and in an IDE. The real challenge is usually not knowing an API exists; it is predicting exact behavior.
- Use detailed explanations to fix patterns. If you miss several questions on streams, generics, modules, or date/time, slow down and rebuild the rule set.
High-yield exam mindset
The Oracle Java SE 17 Developer (1Z0-829) exam rewards precision. Expect questions that test:
| Skill | What to watch |
|---|---|
| Compilation judgment | Access rules, inheritance, generics, var, lambdas, modules, checked exceptions |
| Runtime behavior | Initialization order, polymorphism, exceptions, stream laziness, collection mutation |
| API fluency | String, StringBuilder, collections, streams, dates, NIO.2, JDBC, localization |
| Java 17 language features | Records, sealed classes, pattern matching for instanceof, switch expressions, text blocks |
| Edge cases | Numeric promotion, overload resolution, wildcard bounds, resource closing order, immutability |
A common mistake is reading code as if it were “normal application code.” Exam code is often designed to expose one exact rule.
Java language fundamentals
Source files, packages, imports, and main
| Topic | Rule to remember | Common trap |
|---|---|---|
| One public top-level type | Public top-level type name must match the file name | Non-public top-level classes can share a file |
| Package declaration | If present, it comes before imports and type declarations | Comments can appear before it; imports cannot |
| Imports | import package.Type; or import package.*; | Wildcard import does not import subpackages |
| Static imports | Import static members by name or wildcard | Ambiguous static imports can cause compile errors |
main method | Common form: public static void main(String[] args) | String... args is equivalent; wrong return type is not an entry point |
java.lang | Imported automatically | Other packages are not |
Identifiers, var, and scope
| Feature | Valid use | Invalid or risky use |
|---|---|---|
var local variable inference | Local variables with an initializer | Fields, method parameters, return types |
var initializer | var n = 10; | var x = null; because type cannot be inferred |
| Lambda parameters | Can use var for all lambda parameters | Cannot mix var and explicit/implicit parameter styles |
| Scope | Local variables live within their block | Shadowing can hide fields or outer variables |
Remember: var does not make Java dynamically typed. The type is inferred at compile time and then fixed.
Primitive types and numeric promotion
| Area | Rule |
|---|---|
| Integer literals | Default type is int unless suffixed or context requires otherwise |
| Floating literals | Default type is double; use f or F for float |
byte, short, char arithmetic | Promoted to int in most arithmetic expressions |
| Compound assignment | Includes an implicit cast, so short s = 1; s += 1; can compile where s = s + 1; may not |
| Division | Integer division truncates toward zero |
| Overflow | Integer overflow wraps; it does not throw an exception |
| Boolean | Not numeric; cannot be used as 0 or 1 |
High-yield example: char + char produces an int, not a char.
Equality and object identity
| Expression | Meaning | Trap |
|---|---|---|
a == b for primitives | Numeric or boolean value comparison | Numeric promotion may occur |
a == b for references | Same object reference | Not logical equality |
a.equals(b) | Type-specific equality if overridden | May throw NullPointerException if a is null |
Objects.equals(a, b) | Null-safe equality | Useful for exam reasoning |
| Records | Generated equals compares record components | Component equality still depends on component types |
| Strings | String literals may be interned | Do not assume new String("x") == "x" |
Text, strings, and formatting
String, StringBuilder, and text blocks
| Type / feature | Key properties | Exam trap |
|---|---|---|
String | Immutable | Methods return a new String; original unchanged |
StringBuilder | Mutable, not synchronized | Methods usually mutate and return same builder |
StringBuffer | Mutable, synchronized | Less common in modern code |
| Text blocks | Multiline string literals using triple quotes | Incidental indentation and trailing newline behavior can matter |
String comparison | Use .equals for content | == checks reference identity |
Common String methods to know: charAt, indexOf, substring, replace, trim, strip, isBlank, startsWith, endsWith, contains, split, join, format.
Important distinction:
| Method | Focus |
|---|---|
trim() | Removes characters with code points less than or equal to U+0020 |
strip() | Uses Unicode whitespace awareness |
isEmpty() | Length is zero |
isBlank() | Empty or only whitespace |
Formatting numbers and text
Know the broad roles:
| API | Use |
|---|---|
String.format | Format text using format specifiers |
NumberFormat | Locale-sensitive number, currency, and percent formatting |
DecimalFormat | Custom numeric patterns |
DateTimeFormatter | Date/time parsing and formatting |
Pattern letters are case-sensitive. For date/time formatting, M and m are not interchangeable: month versus minute is a frequent trap.
Control flow
if, loops, labels, break, and continue
| Construct | Review point |
|---|---|
if / else | else binds to the nearest unmatched if |
while | Condition checked before body |
do while | Body executes at least once |
Basic for | Init, condition, update sections are optional |
Enhanced for | Iterates arrays or Iterable objects |
| Labels | Can label loops and blocks, but most useful with nested loops |
break | Exits loop or switch; labeled break exits labeled statement |
continue | Skips to next loop iteration; labeled continue targets a loop |
Enhanced for gives you the element value/reference, not an index. Reassigning the loop variable does not replace array or collection elements.
Switch statements and switch expressions
| Feature | Switch statement | Switch expression |
|---|---|---|
| Purpose | Control flow | Produces a value |
| Fall-through | Possible with colon labels | Arrow labels do not fall through |
| Value required | No | Yes, every path must produce a value or throw |
yield | Not used in classic statement style | Used to return a value from block cases |
| Exhaustiveness | Less strict | More strict |
Common switch-compatible types include integral types and wrappers, String, enums, and certain other supported forms. Do not treat boolean, long, float, or double as normal switch selector types.
High-yield traps:
caselabels must be compatible constants or valid case forms.defaultis optional in some statements but often needed in expressions.- Arrow case syntax and colon case syntax behave differently.
- Missing
breakin colon-style statements can cause fall-through.
Object-oriented programming
Initialization order
For a new object, reason in this order:
- Load and initialize needed classes.
- Initialize superclass static fields and static blocks.
- Initialize subclass static fields and static blocks.
- Allocate object memory with default values.
- Run superclass instance fields, instance initializer blocks, and constructor.
- Run subclass instance fields, instance initializer blocks, and constructor.
Within a class, fields and initializer blocks execute in textual order.
High-yield trap: overridden methods called from constructors use dynamic dispatch, so subclass methods may run before subclass fields are fully initialized.
Access modifiers
| Modifier | Same class | Same package | Subclass in other package | Other package |
|---|---|---|---|---|
private | Yes | No | No | No |
| package-private | Yes | Yes | No | No |
protected | Yes | Yes | Yes, through inheritance rules | No general access |
public | Yes | Yes | Yes | Yes |
protected is commonly misunderstood. A subclass in another package does not get unrestricted access to every protected member on every superclass reference.
Overloading, overriding, and hiding
| Concept | Decided when | Key rule |
|---|---|---|
| Overloading | Compile time | Same method name, different parameter list |
| Overriding | Runtime dispatch | Instance method in subclass replaces superclass behavior |
| Static method hiding | Compile time reference type | Static methods are not polymorphic |
| Field hiding | Compile time reference type | Fields are not polymorphic |
| Covariant return | Override may return subtype | Must still satisfy method contract |
| Checked exceptions | Override cannot throw broader checked exceptions | Runtime exceptions are not restricted the same way |
Overload resolution often chooses the most specific applicable method. Widening, boxing, varargs, and inheritance can interact; practice these with original practice questions until the selection order feels automatic.
Abstract classes, interfaces, enums, records, and sealed types
| Type | High-yield facts |
|---|---|
| Abstract class | Can have constructors, fields, concrete methods, abstract methods |
| Interface | Methods are commonly public abstract; can also have default, static, and private methods |
| Enum | Constants come first; constructors are implicitly private; can have fields and methods |
| Record | Concise immutable data carrier; final; generated constructor, accessors, equals, hashCode, toString |
| Sealed class/interface | Restricts direct permitted subclasses/implementors |
| Non-sealed subtype | Reopens inheritance below a sealed hierarchy |
| Final subtype | Ends inheritance branch |
Records:
- Components become private final fields plus public accessor methods.
- Accessor names are component names, not JavaBean
getXnames by default. - A compact constructor cannot assign directly to component fields before the implicit assignment.
- Records can implement interfaces.
- Records cannot declare additional instance fields beyond record components, but they can declare static fields.
Sealed types:
- Direct subclasses must be permitted.
- Direct subclasses must declare
final,sealed, ornon-sealed. - Sealed hierarchies are a common source of compile-time questions.
Pattern matching for instanceof
Pattern matching reduces casting:
- Traditional idea: check type, then cast.
- Java 17 style:
if (obj instanceof String s) { ... }.
Review points:
| Rule | Trap |
|---|---|
| Pattern variable is available only where definitely matched | Not visible outside invalid scope |
Null does not match an instanceof pattern | null instanceof Type is false |
| Pattern variable has the target type | No separate cast needed |
Exceptions
Checked, unchecked, and errors
| Category | Examples | Compile-time handling required? |
|---|---|---|
| Checked exceptions | IOException, SQLException | Yes: catch or declare |
| Runtime exceptions | NullPointerException, IllegalArgumentException | No |
| Errors | OutOfMemoryError, StackOverflowError | No; usually not handled |
High-yield rules:
- Catch blocks must be ordered from more specific to more general.
- A
catchblock that can never be reached causes a compile error. - Multi-catch alternatives cannot be related by subclassing.
- The exception variable in a multi-catch is effectively final.
- A
finallyblock usually runs whether or not an exception is thrown. - A
finallyblock can suppress or replace an earlier return/throw if it completes abruptly.
Try-with-resources
| Rule | Why it matters |
|---|---|
Resource must implement AutoCloseable or Closeable | Otherwise it cannot be used as a resource |
| Resources close in reverse declaration order | Frequently tested |
| Close exceptions can be suppressed | Primary exception remains primary |
| Resource variables are effectively final | Existing effectively final variables can be used |
Do not forget that close() itself may throw an exception depending on the resource type.
Arrays, collections, and generics
Arrays
| Topic | Rule |
|---|---|
| Length | array.length field, not method |
| Indexing | Zero-based |
| Default values | Numeric zero, false, '\u0000', null references |
| Covariance | String[] is an Object[] |
| Runtime store checks | Wrong subtype assignment can throw ArrayStoreException |
| Multidimensional arrays | Arrays of arrays; inner lengths may differ |
Array covariance is unlike generic invariance. String[] can be assigned to Object[], but List<String> cannot be assigned to List<Object>.
Collections quick map
| Interface / class | Ordered? | Duplicates? | High-yield note |
|---|---|---|---|
ArrayList | Index order | Yes | Fast random access |
LinkedList | Index/insertion order | Yes | Also implements Deque |
HashSet | No guaranteed order | No | Depends on hashCode/equals |
LinkedHashSet | Insertion order | No | Predictable iteration order |
TreeSet | Sorted | No | Requires comparable elements or comparator |
HashMap | No guaranteed order | Keys unique | Key equality uses hashCode/equals |
LinkedHashMap | Insertion/access order options | Keys unique | Predictable iteration order |
TreeMap | Sorted keys | Keys unique | Requires comparable keys or comparator |
ArrayDeque | Deque order | Yes | Often preferred for stack/queue behavior |
PriorityQueue | Priority order for removal | Yes | Iteration order is not sorted order |
Mutability and factory methods
| Creation style | Behavior |
|---|---|
List.of(...), Set.of(...), Map.of(...) | Unmodifiable; reject nulls |
Arrays.asList(array) | Fixed-size list backed by the array |
Collections.unmodifiableList(list) | Unmodifiable view backed by original list |
new ArrayList<>(list) | Independent mutable copy |
High-yield distinction: unmodifiable is not the same as immutable if the underlying data can still change through another reference.
Generics and wildcards
| Form | Meaning | Safe mental model |
|---|---|---|
List<T> | Exact type parameter | Invariant |
List<?> | Unknown type | Read as Object; cannot add specific elements except null |
List<? extends Number> | Some subtype of Number | Producer: read Number, do not add numbers |
List<? super Integer> | Some supertype of Integer | Consumer: can add Integer; reads as Object |
| Raw type | Generic type without type argument | Allows unsafe operations and warnings |
Use PECS: Producer Extends, Consumer Super.
Common traps:
- Generic type parameters are erased at runtime.
- You cannot create
new T()directly. - You cannot create a normal array of a parameterized type such as
new List<String>[10]. List<Integer>is not a subtype ofList<Number>.
Sorting and comparison
| API | Purpose |
|---|---|
Comparable<T> | Natural ordering using compareTo |
Comparator<T> | External ordering strategy |
Comparator.comparing | Build comparator from key extractor |
thenComparing | Tie-breaker |
reversed | Reverse order |
Collections.sort / List.sort | Sort lists |
Arrays.sort | Sort arrays |
binarySearch | Requires sorted input according to same ordering |
If input is not sorted correctly, binary search results are not reliable.
Lambdas, functional interfaces, and streams
Functional interfaces
A functional interface has exactly one abstract method, though it may also have default, static, and private methods.
| Interface | Abstract method idea | Example use |
|---|---|---|
Predicate<T> | T -> boolean | Filtering |
Consumer<T> | T -> void | Performing side effects |
Supplier<T> | () -> T | Creating/providing values |
Function<T,R> | T -> R | Mapping |
UnaryOperator<T> | T -> T | Same-type transform |
BinaryOperator<T> | (T,T) -> T | Combining |
BiFunction<T,U,R> | (T,U) -> R | Two-input mapping |
Lambda traps:
- Captured local variables must be final or effectively final.
- Parameter types can be inferred, but syntax must be consistent.
- A lambda body with braces needs explicit
returnfor non-void results. - Method references must match the target functional interface signature.
Stream pipeline rules
| Stage | Examples | Key point |
|---|---|---|
| Source | Collection, array, file lines, generated stream | Provides elements |
| Intermediate operations | filter, map, flatMap, sorted, distinct, limit, skip, peek | Lazy; return another stream |
| Terminal operations | collect, reduce, count, forEach, anyMatch, findFirst | Trigger processing and close pipeline |
| Reuse | Not allowed after terminal operation | Causes IllegalStateException |
Streams do not modify the source unless the operation itself causes side effects. Prefer side-effect-free lambdas, especially with parallel streams.
Intermediate operations
| Operation | Purpose | Trap |
|---|---|---|
filter | Keep matching elements | Predicate returns boolean |
map | One element to one element | Can change element type |
flatMap | One element to stream of elements | Flattens nested streams |
distinct | Remove duplicates | Uses equality |
sorted | Sort natural or comparator order | May need comparable elements |
peek | Observe elements | Lazy; mainly debugging |
limit | Truncate stream | Important for infinite streams |
skip | Discard first n elements | Order matters |
takeWhile | Take while predicate remains true | Most useful on ordered streams |
dropWhile | Drop while predicate remains true | Behavior differs for unordered streams |
Terminal operations
| Operation | Returns | Review point |
|---|---|---|
count | long | Counts elements |
min / max | Optional<T> | Need comparator |
findFirst | Optional<T> | Encounter-order sensitive |
findAny | Optional<T> | Useful in parallel pipelines |
anyMatch | boolean | Short-circuiting |
allMatch | boolean | True for empty stream |
noneMatch | boolean | True for empty stream |
forEach | void | Order not guaranteed in parallel |
forEachOrdered | void | Preserves encounter order where applicable |
reduce | Value or Optional | Identity/accumulator/combiner rules matter |
collect | Collection, map, string, summary | Uses collectors or custom collector |
Collectors
| Collector | Use |
|---|---|
toList, toSet, toMap | Collect elements into containers |
joining | Combine strings |
groupingBy | Map keys to grouped values |
partitioningBy | Split into true/false groups |
mapping | Downstream transformation |
counting | Count elements downstream |
summingInt, averagingDouble, etc. | Numeric aggregation |
summarizingInt, etc. | Count, sum, min, max, average |
reducing | Downstream reduction |
toMap is a common trap: duplicate keys require a merge function unless the data guarantees uniqueness.
Primitive streams and Optional
| Type | Purpose |
|---|---|
IntStream, LongStream, DoubleStream | Avoid boxing for primitive pipelines |
Optional<T> | Container for possibly absent reference value |
OptionalInt, OptionalLong, OptionalDouble | Primitive optional variants |
Know common Optional methods: isPresent, isEmpty, get, orElse, orElseGet, orElseThrow, ifPresent, map, flatMap, filter.
High-yield distinction:
| Method | Behavior |
|---|---|
orElse(value) | Argument is evaluated before the call |
orElseGet(supplier) | Supplier runs only when optional is empty |
Date, time, and localization
Java date/time API
Most java.time types are immutable.
| Type | Represents |
|---|---|
LocalDate | Date without time zone |
LocalTime | Time without date or zone |
LocalDateTime | Date and time without zone |
ZonedDateTime | Date and time with time zone |
OffsetDateTime | Date and time with offset |
Instant | Machine timestamp |
Period | Date-based amount: years, months, days |
Duration | Time-based amount: seconds, nanoseconds |
Common traps:
Periodis for dates;Durationis for time-based amounts.- Date/time objects are immutable;
date.plusDays(1)returns a new object. - Formatting patterns are case-sensitive.
- Some operations may adjust invalid dates, such as month-end calculations.
- Time zones and daylight saving transitions can affect
ZonedDateTime.
Localization
| API | Use |
|---|---|
Locale | Language, country/region, variant information |
ResourceBundle | Locale-specific text/resources |
NumberFormat | Locale-sensitive numbers, currency, percentages |
DateTimeFormatter | Date/time formatting with locale support |
MessageFormat | Parameterized localized messages |
Resource bundle lookup can fall back through less-specific locales. Practice questions often test which bundle is selected or whether a key is found.
Java I/O and NIO.2
Path and Files
| API | Purpose | Trap |
|---|---|---|
Path | Represents a path | Path object may refer to nonexistent file |
Paths.get / Path.of | Create paths | Does not require file to exist |
normalize | Remove redundant path elements | Does not access filesystem |
toAbsolutePath | Convert to absolute path | Does not necessarily verify existence |
toRealPath | Resolve real filesystem path | Accesses filesystem and can throw |
resolve | Combine paths | Absolute right-hand path may override |
relativize | Path from one path to another | Usually requires compatible path types |
Files.exists | Existence check | Can be affected by permissions |
Files.copy / move / delete | File operations | Options change behavior |
Files.walk / find / list | Stream paths | Close streams |
Byte streams, character streams, and buffering
| Category | Examples | Use |
|---|---|---|
| Byte streams | InputStream, OutputStream | Binary data |
| Character streams | Reader, Writer | Text data |
| Buffered streams/readers | BufferedInputStream, BufferedReader | Efficiency |
| Object streams | ObjectInputStream, ObjectOutputStream | Serialization |
Remember to close I/O resources. Try-with-resources is the standard exam-safe pattern.
Serialization review
| Rule | Why it matters |
|---|---|
Class must implement Serializable | Marker interface enables standard serialization |
transient fields are not serialized normally | They receive default values on deserialization |
| Static fields are not part of object state | Class-level, not instance state |
serialVersionUID | Version compatibility identifier |
| Constructors | Deserialization does not call the serializable class’s normal constructor |
Serialization questions often combine inheritance, transient, static fields, and default values.
Concurrency
Threads, tasks, and executors
| Concept | Review point |
|---|---|
Thread | Represents an execution thread |
Runnable | Task with no return value and no checked exception from run |
Callable<V> | Task returning a value and allowed to throw checked exceptions |
ExecutorService | Manages task execution |
execute | Submits Runnable, no result |
submit | Returns Future |
Future.get | Blocks until result or exception |
shutdown | Stops accepting new tasks; existing tasks continue |
shutdownNow | Attempts to stop running tasks and returns pending tasks |
High-yield trap: creating a Thread object does not start execution. Calling run() directly is just a normal method call; start() starts a new thread.
Synchronization and shared state
| Tool | Purpose | Trap |
|---|---|---|
synchronized instance method/block | Lock on an object instance | Different objects mean different locks |
synchronized static | Lock on class object | Separate from instance lock |
volatile | Visibility guarantee | Does not make compound actions atomic |
| Atomic classes | Atomic updates like increment | Know common classes such as AtomicInteger |
| Concurrent collections | Safer concurrent access | Iteration semantics may differ from fail-fast collections |
| Locks | Explicit lock/unlock control | Must release in finally when used manually |
Common concurrency errors:
- Race condition: result depends on timing.
- Deadlock: threads wait forever for each other’s locks.
- Starvation: a thread cannot get needed resources.
- Livelock: threads keep reacting but make no progress.
- Unsafe publication: other threads see stale or partially initialized state.
Parallel streams
Parallel streams can improve throughput for suitable workloads, but exam questions often focus on correctness:
- Avoid shared mutable state.
- Do not assume
forEachpreserves order. - Use associative, stateless operations for reductions.
findAnymay differ fromfindFirst.- Side effects become harder to reason about.
JDBC
Core JDBC flow
| Step | API |
|---|---|
| Get connection | DriverManager or DataSource |
| Create statement | Statement, PreparedStatement, or CallableStatement |
| Bind parameters | PreparedStatement setters use 1-based parameter indexes |
| Execute | executeQuery, executeUpdate, or execute |
| Read results | ResultSet cursor starts before first row; call next() |
| Clean up | Try-with-resources |
| Manage transaction | setAutoCommit, commit, rollback |
Statement selection
| Type | Use |
|---|---|
Statement | Simple SQL without parameters |
PreparedStatement | Parameterized SQL; helps avoid SQL injection |
CallableStatement | Stored procedures |
Execution method traps:
| Method | Best fit |
|---|---|
executeQuery | SQL that returns a ResultSet |
executeUpdate | INSERT, UPDATE, DELETE, DDL; returns update count |
execute | General method; returns boolean indicating result type |
Always distinguish SQL parameter indexes from Java array indexes: JDBC parameters are commonly 1-based.
Modules and deployment
Java Platform Module System essentials
| Directive | Meaning |
|---|---|
requires | Module depends on another module |
requires transitive | Dependency is exposed to modules that require this module |
requires static | Needed at compile time but optional at runtime |
exports | Makes package public to other modules at compile time and runtime |
exports ... to | Qualified export to specific modules |
opens | Allows deep reflection at runtime |
opens ... to | Qualified reflective access |
uses | Declares service consumption |
provides ... with | Declares service provider implementation |
Module review points:
java.baseis required implicitly.module-info.javadeclares module dependencies and exposed packages.- Packages are the unit of export, not individual classes.
- Public class does not mean accessible outside the module unless its package is exported.
- Reflection-heavy frameworks may require
opens, not merelyexports. - Named modules, unnamed modules, and automatic modules behave differently.
- Split packages across modules can create problems.
JARs and command-line awareness
Know the purpose, not just syntax:
| Tool / concept | Purpose |
|---|---|
javac | Compile source |
java | Run application |
jar | Package classes/resources |
| Module path | Locate modules |
| Classpath | Locate non-modular classes/resources |
jdeps | Analyze dependencies |
jlink | Create custom runtime images |
Practice command-line questions carefully; one misplaced module name or path option can change the answer.
Annotations
Built-in and meta-annotations
| Annotation | Purpose |
|---|---|
@Override | Compiler verifies method override |
@FunctionalInterface | Compiler verifies single abstract method |
@Deprecated | Marks obsolete API |
@SuppressWarnings | Suppresses selected compiler warnings |
@SafeVarargs | Suppresses heap pollution warnings for safe varargs use |
@Retention | Controls how long annotation is retained |
@Target | Controls where annotation can be used |
@Repeatable | Allows repeated annotation use |
@Inherited | Allows class annotation inheritance behavior |
@Documented | Includes annotation in generated documentation |
Annotation element rules:
- Element types are restricted to primitives,
String,Class, enums, annotations, and arrays of those types. - Elements can have default values.
- If the only required element is named
value, shorthand syntax can be used. - Retention matters: reflection requires runtime retention.
Security and robustness mindset
The exam may combine API knowledge with safe coding judgment. Keep these habits in mind:
| Risk | Safer approach |
|---|---|
| SQL injection | Use PreparedStatement parameters |
| Exposed mutable internals | Defensive copies or immutable views |
| Resource leaks | Try-with-resources |
| Unsafe deserialization | Validate and minimize serialized surface |
| Shared mutable state | Synchronization, immutability, atomic classes, concurrent collections |
| Sensitive data in logs | Avoid unnecessary exposure |
| Path traversal | Validate and normalize paths carefully |
For question-bank practice, treat “secure” answers as those that reduce trust in external input, avoid unnecessary mutability, and close resources predictably.
Common compile-time traps
| Code pattern | Likely issue |
|---|---|
Using var without initializer | Cannot infer type |
Assigning int expression to short | Numeric promotion |
| Catching superclass exception before subclass | Unreachable catch |
| Lambda captures modified local variable | Not effectively final |
Adding to List<? extends Number> | Unsafe; compile error except null |
| Overriding with broader checked exception | Compile error |
| Calling private method as if overridden | Private methods are not overridden |
| Accessing non-exported module package | Not accessible outside module |
| Mixing lambda parameter styles | Compile error |
| Creating generic array | Usually illegal |
| Missing return in switch expression path | Compile error |
| Record with extra instance field | Compile error |
Sealed subclass lacking final, sealed, or non-sealed | Compile error |
Common runtime traps
| Code pattern | Possible result |
|---|---|
| Downcast without valid object type | ClassCastException |
| Store wrong subtype into covariant array | ArrayStoreException |
| Dereference null | NullPointerException |
| Access invalid array/list index | ArrayIndexOutOfBoundsException or IndexOutOfBoundsException |
| Reuse consumed stream | IllegalStateException |
| Modify collection during iteration | ConcurrentModificationException in many fail-fast cases |
| Parse invalid number/date | Parsing exception |
JDBC read before ResultSet.next() | Invalid cursor position |
| Future task throws exception | ExecutionException from Future.get() |
| File operation without permissions or missing path | I/O exception or failed existence check |
Fast topic drill map
Use this table to decide what to practice next in an IT Mastery question bank.
| If you miss questions on… | Drill these topics |
|---|---|
| “Does it compile?” | Access modifiers, overload/override, checked exceptions, generics, var, records, sealed classes |
| Unexpected output | Initialization order, polymorphism, string immutability, numeric promotion, switch fall-through |
| Collections | Equality, hashing, sorting, mutability, wildcards, factory methods |
| Streams | Laziness, terminal operations, collectors, optionals, primitive streams, parallel behavior |
| Date/time | Immutability, Period vs Duration, formatter patterns, locale behavior |
| I/O | Path operations, Files methods, try-with-resources, serialization |
| Concurrency | Executors, Future, synchronization, volatile, atomics, race conditions |
| JDBC | Statement type, execution method, transaction handling, cursor movement |
| Modules | requires, exports, opens, service directives, module path vs classpath |
| Localization | Locale, ResourceBundle fallback, number/date formatting |
Final pre-practice checklist
Before starting a mock exam for Oracle Java SE 17 Developer (1Z0-829), confirm that you can:
- Predict whether short Java snippets compile.
- Explain overload resolution and override dispatch.
- Trace object initialization order.
- Distinguish identity, equality, and ordering.
- Use generics wildcards without guessing.
- Identify stream source, intermediate operations, terminal operation, and result type.
- Choose correct collection implementations for ordering, uniqueness, and sorting.
- Explain
Period,Duration, and corejava.timeclasses. - Know when I/O and JDBC resources are opened, used, and closed.
- Recognize concurrency hazards in shared mutable state.
- Read
module-info.javadirectives accurately. - Spot when mutability, reflection, serialization, SQL, or file paths create safety issues.
Practical next step
Pick one weak area from the drill map and complete a focused set of original practice questions with detailed explanations. Then take a mixed mock exam only after your topic drills show that you can explain both the correct answer and the traps in the distractors.
Continue in IT Mastery
Use this Quick Review as a final concept map, then move into IT Mastery for focused topic drills, mixed practice sets, timed mock exams, and detailed explanations. The practice questions are original IT Mastery practice items; they are not official Oracle questions, copied live-exam content, or exam dumps.