Java SE 17 (1Z0-829) key terms
Java SE 17 (1Z0-829) · Get comfortable with the vocabulary.
- LocalDate
- Related: LocalDateTime, DateTimeFormatter
An immutable date without time or zone, storing year, month, and day. Created via LocalDate.of, now, or parse; supports plusDays, minusMonths, and formatting with DateTimeFormatter.
- LocalDateTime
- Related: LocalDate, ZonedDateTime
An immutable date-time without a time zone, combining LocalDate and LocalTime. Created via of, now, or parse; supports plusHours, withDayOfMonth, and conversion to LocalDate or LocalTime.
- ZonedDateTime
- Related: ZoneId, Instant
An immutable date-time with a time zone, such as America/New_York. Handles daylight saving transitions; created via now, of, or atZone on a LocalDateTime.
- Instant
- Related: Duration, ZonedDateTime
A point on the UTC timeline, measured in seconds and nanoseconds from the epoch 1970-01-01T00:00:00Z. Commonly used for timestamps; created via now or ofEpochSecond.
- Duration
- Related: Period, Instant
A time-based amount, such as 2 hours or 30 seconds, stored as seconds and nanoseconds. Created via Duration.ofHours or between; supports plus, minus, and toMinutes.
- Period
- Related: Duration, LocalDate
A date-based amount in years, months, and days, such as 1 year and 2 months. Created via Period.of or between; supports plus, minus, and getYears.
- DateTimeFormatter
- Related: LocalDate, LocalDateTime
A formatter for printing and parsing date-time objects using patterns like yyyy-MM-dd. Created via ofPattern or predefined constants such as ISO_LOCAL_DATE; immutable and thread-safe.
- ZoneId
- Related: ZonedDateTime, Instant
An identifier for a time zone, such as Europe/Paris or a fixed offset like +02:00. Used with ZonedDateTime and to convert between Instant and local date-time.
- String immutability
- Related: StringBuilder, String pool
The property that a String's character content never changes after creation; methods like concat or replace return new strings. Enables safe sharing and caching of string literals.
- StringBuilder
- Related: String immutability, String pool
A mutable sequence of characters with methods like append, insert, and reverse. Not thread-safe; use StringBuffer for synchronized access. toString returns a String snapshot.
- String pool
- Related: String immutability, equals method
A region of the heap where string literals are stored and reused. The intern method returns a pooled reference; == compares references, not content.
- equals method
- Related: hashCode contract, String pool
The method used to compare object content for equality. For strings, equals compares characters; overriding equals requires a consistent hashCode for hash-based collections.
- hashCode contract
- Related: equals method, HashMap
The rule that equal objects must return the same hash code, though unequal objects may share one. Violations break HashMap and HashSet behavior; must be overridden with equals.
- List interface
- Related: ArrayList, Set interface
An ordered collection that allows duplicates and positional access via index. Common implementations include ArrayList and LinkedList; supports add, get, set, and remove.
- ArrayList
- Related: List interface, LinkedList
A resizable-array implementation of List. Offers fast random access and amortized constant-time append; insertion or removal in the middle shifts elements.
- LinkedList
- Related: ArrayList, Deque interface
A doubly linked list implementing List and Deque. Constant-time insertion and removal at ends; slower random access than ArrayList because it traverses nodes.
- Set interface
- Related: HashSet, TreeSet
A collection that contains no duplicate elements. Implementations include HashSet, LinkedHashSet, and TreeSet; uniqueness is determined by equals and hashCode.
- HashSet
- Related: Set interface, HashMap
A Set backed by a HashMap, offering constant-time add, remove, and contains on average. Iteration order is unspecified; permits one null element.
- TreeSet
- Related: Set interface, Comparator
A sorted Set backed by a TreeMap. Elements are ordered by natural ordering or a Comparator; operations are O(log n). Does not permit null elements.
- HashMap
- Related: hashCode contract, TreeMap
A Map implementation storing key-value pairs in a hash table. Allows one null key and multiple null values; average constant-time get and put; iteration order is unspecified.
- TreeMap
- Related: HashMap, Comparator
A sorted Map backed by a red-black tree. Keys are ordered by natural ordering or a Comparator; operations are O(log n). Does not permit null keys.
- Stream
- Related: Intermediate operation, Terminal operation
A sequence of elements supporting sequential and parallel aggregate operations. Created from collections via stream; operations are lazy until a terminal operation is invoked.
- Intermediate operation
- Related: Stream, Terminal operation
A stream operation such as filter, map, or sorted that returns another stream and is lazy. It does not execute until a terminal operation is called.
- Terminal operation
- Related: Stream, Intermediate operation
A stream operation such as collect, forEach, or reduce that produces a result or side effect and consumes the stream. A stream cannot be reused after a terminal operation.
- Optional
- Related: Stream, Terminal operation
A container that may or may not hold a non-null value. Methods include of, ofNullable, empty, orElse, and ifPresent; helps avoid NullPointerException in stream results.
- switch statement
- Related: switch expression, yield statement
A control-flow statement that selects among cases based on a value. Supports byte, short, char, int, String, and enum; requires break to prevent fall-through.
- switch expression
- Related: switch statement, yield statement
A switch used as an expression that returns a value. Uses arrow labels (case X ->) and must be exhaustive; no fall-through. Introduced in Java 14.
- yield statement
- Related: switch expression, switch statement
A statement used inside a switch expression block to return a value. Unlike return, it exits the switch expression, not the enclosing method.
- while loop
- Related: do-while loop, for loop
A loop that evaluates a boolean condition before each iteration and repeats while true. If false initially, the body never executes.
- do-while loop
- Related: while loop, for loop
A loop that executes its body at least once, then repeats while a boolean condition is true. The condition is checked after each iteration.
- for loop
- Related: while loop, break statement
A loop with initialization, condition, and update sections, or an enhanced form that iterates over arrays and Iterable collections. The enhanced for cannot modify the underlying collection safely.
- break statement
- Related: continue statement, for loop
A statement that exits the innermost loop or switch immediately. With a label, it can exit an outer loop.
- continue statement
- Related: break statement, for loop
A statement that skips the rest of the current loop iteration and proceeds to the next iteration. With a label, it can skip to an outer loop.
- checked exception
- Related: unchecked exception, try-catch-finally
An exception that must be either caught or declared in a throws clause. Subclasses of Exception except RuntimeException; compiler enforces handling.
- unchecked exception
- Related: checked exception, try-catch-finally
An exception that does not require explicit handling. Subclasses of RuntimeException and Error; examples include NullPointerException and IllegalArgumentException.
- try-catch-finally
- Related: try-with-resources, checked exception
A construct for handling exceptions. The try block contains risky code, catch handles specific exceptions, and finally always executes, even after return or an uncaught exception.
- try-with-resources
- Related: try-catch-finally, AutoCloseable
A try statement that automatically closes resources implementing AutoCloseable at the end. Resources are closed in reverse order of declaration; suppresses close exceptions.
- var
- Related: Local variable type inference, var in lambda parameters
A reserved type name for local variable type inference. The compiler infers the type from the initializer; cannot be used for fields, method parameters, or without an initializer.
- Local variable type inference
- Related: var, var in lambda parameters
The feature allowing local variables to be declared with var, letting the compiler infer the type. Requires an initializer and cannot infer null or lambda without a target type.
- var in lambda parameters
- Related: var, Lambda expression
The ability to use var in lambda parameter declarations, e.g., (var x, var y) -> x + y. Requires all parameters to use var or none; enables annotations on parameters.
- Lambda expression
- Related: Functional interface, var in lambda parameters
A concise syntax for implementing a functional interface, e.g., (a, b) -> a + b. Parameter types may be inferred; body can be an expression or block.
- Functional interface
- Related: Lambda expression, Method reference
An interface with exactly one abstract method, eligible for lambda expressions and method references. May have default and static methods; annotated with @FunctionalInterface optionally.
- Method reference
- Related: Lambda expression, Functional interface
A shorthand for a lambda that invokes an existing method, using syntax like System.out::println or String::length. Four kinds: static, instance, arbitrary object, and constructor.
- Inheritance
- Related: Polymorphism, Abstract class
A mechanism where a class derives from a superclass, inheriting accessible fields and methods. Java supports single class inheritance; overridden methods use dynamic dispatch.
- Polymorphism
- Related: Inheritance, Interface
The ability of an object to take multiple forms, enabling a supertype reference to invoke subclass overrides at runtime. Achieved via inheritance and interfaces.
- Interface
- Related: Abstract class, Polymorphism
A reference type declaring abstract methods, default methods, static methods, and constants. A class can implement multiple interfaces; default methods provide implementations.
- Abstract class
- Related: Interface, Inheritance
A class that cannot be instantiated and may contain abstract methods. Subclasses must implement abstract methods or also be abstract. Supports constructors and fields.
- Record
- Related: equals method, hashCode contract
A compact class declaration for immutable data, automatically generating constructor, accessors, equals, hashCode, and toString. Introduced in Java 16; cannot extend other classes.