Class PatternMatchingInstanceofPreviewExamples
java.lang.Object
net.jrodolfo.java_evolution.java14.PatternMatchingInstanceofPreviewExamples
Demonstrates pattern matching for
instanceof as a Java 14 preview
feature.
Before this feature, type checks often required a separate cast after
instanceof. That repeated the type and created room for mistakes.
Pattern matching for instanceof solves this by combining the type
check and local variable binding. The feature became final in Java 16. The
example uses final syntax because this repository compiles with JDK 25.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PatternMatchingInstanceofPreviewExamples
public PatternMatchingInstanceofPreviewExamples()
-
-
Method Details
-
describe
-