Browse Oracle Certification Guides

1Z0-830 Java 21 Sealed Types and Overrides Guide

Study 1Z0-830 Java 21 Sealed Types and Overrides: key concepts, common traps, and exam decision cues.

Polymorphism questions are usually won by candidates who keep three things separate: declared type, runtime type, and narrowing safety.

Polymorphism chooser

If the stem is mainly about… Better first instinct
extension control check final, sealed, and permitted-subclass rules
method behavior through a parent reference runtime dispatch decides overriding behavior
cast safety separate compile-time possibility from runtime ClassCastException risk
type test plus narrowing pattern matching may replace manual cast logic safely

What the exam is really testing

If the code shows… Strong reading
@Override and same method name overriding rules are under test, not overloading
sealed parent with a small set of subtypes exhaustiveness and hierarchy control matter
cast after an instanceof check safe narrowing is likely the point
parent reference calling child implementation declared access and runtime dispatch both matter

Common traps

Trap Better rule
assuming the parent reference changes the runtime implementation overriding still dispatches by runtime type
treating all casts as equally risky some fail at compile time, others fail at runtime
ignoring sealed hierarchy clues in switch or pattern questions closed hierarchies change what counts as exhaustive

Quiz

Loading quiz…
Revised on Sunday, May 10, 2026