Class PatternMatchingInstanceofExamples
java.lang.Object
net.jrodolfo.java_evolution.java16.PatternMatchingInstanceofExamples
Demonstrates pattern matching for
instanceof, finalized in Java 16.
Before this feature, type checks usually required a separate cast after
instanceof. That repeated the type and made simple type-dependent
logic more verbose than necessary.
Pattern matching solves this by combining the type check and local variable binding in one expression.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PatternMatchingInstanceofExamples
public PatternMatchingInstanceofExamples()
-
-
Method Details
-
describe
-