Browse by Topic
Popular
Popular Posts
Latest
Latest Java Posts
Java Inner Class: Syntax, Types, and When to Use Them
Understand Java inner and nested classes—member, local, anonymous, and static nested—with syntax examples, access rules, and practical guidance.
Java Nested Class: Types, Syntax, and Memory Behavior
An overview of Java's four nested class types: static nested, inner, local, and anonymous. Covers syntax, access rules, memory behavior, and when to use each kind.
Java Sealed Interface Implementation
Learn how to implement sealed interfaces in Java: the permits clause, restrictions, records, exhaustive pattern matching, and API design trade-offs.
Java Sealed Class Inheritance: Syntax and Rules
Learn how Java sealed class inheritance restricts direct subtypes, which modifiers permitted subtypes need, and how sealed hierarchies support exhaustive pattern matching.
Java Sealed vs Final: Key Differences
Sealed and final classes both control inheritance in Java, but they solve different problems. See the syntax, behavior, and when to use each.
Java non-sealed Keyword: Extending Sealed Types
The Java non-sealed keyword reopens a sealed type hierarchy to arbitrary subclasses. Learn how it works, when to use it, and how it affects subtype extensibility.
Understanding the Java Permits Keyword in Sealed Classes
The Java `permits` keyword defines the allowed subclasses in sealed classes and interfaces. This guide covers syntax, constraints, and runtime behavior.
Using Java Sealed Interfaces for Exhaustive Pattern Matching
Java sealed interfaces restrict implementations and enable compiler-checked exhaustive switch expressions. See how to declare them, compare them with sealed classes, and understand when to use them.
Java Sealed Keyword: Restricting Inheritance
Learn how Java's sealed keyword restricts class hierarchies, enables exhaustive switching, and improves maintainability in Java 17+.
Using Java Sealed Classes to Control Inheritance
Learn how Java sealed classes restrict inheritance, enable exhaustive pattern matching, and improve API design with practical examples.