Java Inheritance, Polymorphism, Overriding and Sealed Classes (1Z0-831)
Inheritance in Java lets a class extend one superclass and reuse or override its instance methods, and polymorphism is the result: a call through a superclass-typed reference runs the method body of the object's actual class. Oracle 1Z0-831 objective 3.5 asks you to implement that in code — including abstract classes, sealed classes and interfaces, and records in a hierarchy — to override methods, including those of Object, and to tell the reference type from the object type. This lesson separates what the compiler decides from what the JVM decides, sets out the exact rules for a legal override, shows why fields, static and private methods are hidden rather than overridden, covers casts, constructor chaining and Java 25's flexible constructor bodies, and finishes with sealed hierarchies in exhaustive switches and the equals/hashCode contract.
You’ve read your 2 free 1Z0-831 lessons
Sign up free to read 48 more lessons — your progress is saved.
Source
This lesson covers the "Applying Object-Oriented Principles in Java Programs" domain of the official 1Z0-831 exam guide. Vendors revise their guides — check the source for the current version.
- Java SE 25 Developer Professional (1Z0-831) exam page and topics — Oracle University
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.