March 2019
Intermediate to advanced
242 pages
6h 21m
English
Pattern matching will enhance the Java programming language. To start with, it will add type test patterns and constant patterns that will be supported by the switch statement and the matches expression. Later, this JEP might extend the supported patterns and language construct.
Pattern matching is an age-old technique (approximately 65 years old) that has been adapted and is used by various languages such as text-oriented, functional (Haskell), and object-oriented languages (Scala, C#).
A pattern is a combination of the following:
When a predicate is successfully applied to a target, a set of binding variables are extracted from the target. The patterns covered in this chapter ...
Read now
Unlock full access