Pattern matching (since Java 16)
GPTKB entity
Statements (18)
Predicate | Object |
---|---|
gptkbp:instanceOf |
Java language feature
|
gptkbp:appliesTo |
instanceof operator
|
gptkbp:category |
type system
Java syntax |
gptkbp:enables |
type pattern declaration in instanceof
|
gptkbp:example |
if (obj instanceof String s) { ... }
|
https://www.w3.org/2000/01/rdf-schema#label |
Pattern matching (since Java 16)
|
gptkbp:improves |
readability
conciseness |
gptkbp:introducedIn |
gptkb:Java_16
|
gptkbp:JEP_number |
gptkb:JEP_394
|
gptkbp:purpose |
simplify type checks and casts
|
gptkbp:relatedTo |
sealed classes
record classes |
gptkbp:statusInJava16 |
preview feature
|
gptkbp:statusInJava17 |
standard feature
|
gptkbp:bfsParent |
gptkb:Java_Standard_Edition
|
gptkbp:bfsLayer |
7
|