Loading…
Loading…
Java
Exam-prep course for the Oracle Certified Professional Java SE 21 Developer exam (1Z0-830), with notes on the Java 25 successor exam (1Z0-831). Every article ships with a verified practice quiz.
Record patterns for the OCP 21 exam: deconstructing records with instanceof, the component rules, how nested pattern types match at run time, nested record patterns, var and generics in patterns, record patterns in switch with when guards, exhaustiveness, and what changed in Java 22 to 25.
kvi5hnuCode Sprout team member7 minJava records for the OCP 21 exam: encapsulation and why records exist, the members the compiler generates, long, compact and overloaded constructors, transforming parameters, immutability, implementing interfaces, and what records may and may not declare.
kvi5hnuCode Sprout team member7 minSealed classes and interfaces for the OCP 21 exam: sealed and permits, the final, sealed or non-sealed rule for direct subclasses, same package or module, when permits can be omitted, nested subclasses, sealed interfaces, and exhaustive pattern-matching switches.
kvi5hnuCode Sprout team member7 minJava enums for the OCP 21 exam: simple enums, values(), name(), ordinal() and valueOf(), enums in switch (including qualified case labels new in Java 21), complex enums with fields and private constructors, constant-specific bodies, abstract methods and interfaces.
kvi5hnuCode Sprout team member7 minConcrete interface methods for the OCP 21 exam: default methods and their six rules, resolving duplicate defaults with Interface.super, the class-wins rule, static interface methods that aren't inherited, private and private static helpers, and who may call what.
kvi5hnuCode Sprout team member8 minJava interfaces for the OCP 21 exam: declaring and implementing them, implicit modifiers on constants and abstract methods, extending multiple interfaces, duplicate abstract methods, class versus interface keywords, plus the @Deprecated, @SuppressWarnings and @SafeVarargs annotations.
kvi5hnuCode Sprout team member7 minWriting immutable classes in Java for the OCP 21 exam: the five-step recipe, why final fields aren't enough, defensive copies in constructors and accessors, List.copyOf versus unmodifiable views, arrays, and how records fit in.
kvi5hnuCode Sprout team member7 minJava abstract classes for the OCP 21 exam: declaring abstract classes and methods, the first concrete subclass rule, constructors in abstract classes, anonymous subclasses, illegal modifier combinations (abstract with final, private or static) and the syntax traps the exam loves.
kvi5hnuCode Sprout team member7 minJava method overriding for the OCP 21 exam: the four compiler rules (signature, access, checked exceptions, covariant returns), @Override, redeclaring private methods, hiding static methods and fields, final methods, and how each is chosen at run time or compile time.
kvi5hnuCode Sprout team member8 minJava initialization order for the OCP 21 exam: when a class is initialized and when it isn't, static and instance initializers in source order, parent-first object construction, final and static final fields assigned exactly once, forward references, and the overridable-method trap.
kvi5hnuCode Sprout team member10 minJava constructors for the OCP 21 exam: declaring and overloading them, when the compiler adds a default constructor, private constructors, chaining with this(), calling the parent with super(), the inserted super() call and its traps, and Java 25 flexible constructor bodies.
kvi5hnuCode Sprout team member8 minInheritance basics for the OCP Java 21 exam: extends and single inheritance, java.lang.Object as the root of every class, which members a subclass inherits, final and other class modifiers, top-level class access, and how this and super resolve fields and methods.
kvi5hnuCode Sprout team member8 minMethod overloading for the OCP Java 21 exam: what makes a valid overload, and the order Java uses to pick one, from exact match and widening through boxing to varargs, plus the most specific rule, reference types, null arguments, float vs double, and ambiguous calls.
kvi5hnuCode Sprout team member7 minHow Java passes data into and out of methods for the OCP 21 exam: pass-by-value for primitives and references, mutating versus reassigning a parameter, ignored return values, and autoboxing and unboxing rules, including the no-widen-then-box limit, null unboxing and the Integer cache.
kvi5hnuCode Sprout team member8 minstatic fields and methods for the OCP Java 21 exam: shared class state, accessing static members through the class or through a (even null) reference, why static code can't use instance members directly, static final constants, static initializers, and the rules and traps of static imports.
kvi5hnuCode Sprout team member8 minThe four Java access levels for the OCP 21 exam: private, package (no keyword), protected and public, with the full access table, why protected through a superclass reference fails in another package, protected constructors and static members, and how modules affect public.
kvi5hnuCode Sprout team member8 minVariables inside and around Java methods for the OCP 21 exam: the only local variable modifier (final), deferred final assignment, effectively final variables and lambdas, final/volatile/transient instance fields, and the rules for declaring and calling varargs methods.
kvi5hnuCode Sprout team member8 minEvery part of a Java method declaration as tested on the OCP Java 21 exam: access modifiers, optional specifiers and their order, return types and return statements, legal method names, parameter lists, the method signature, the throws clause and the body.
kvi5hnuCode Sprout team member10 minAmounts of time on the OCP Java 21 exam: Period for years, months and days, Duration for hours down to nanoseconds, their toString formats, ChronoUnit.between and truncatedTo, which types accept which amount, Instant, and how ZonedDateTime handles US daylight saving time.
kvi5hnuCode Sprout team member10 minThe java.time types on the OCP Java 21 exam: picking LocalDate, LocalTime, LocalDateTime or ZonedDateTime, creating them with of() and now(), time zone offsets, plus/minus/with/at methods, end-of-month rules, immutability traps and DateTimeException.
kvi5hnuCode Sprout team member11 min