Language selector

instanceof

In the chase for non-trivial examples to illustrate possible usage of JEP 305, some people might have gone too far, I guess. In particular into the more challenging area of the equals() method, present in all Java objects.
Java 14 has a lot of new features. One of them (as preview feature) is pattern matching with instanceof. Some people programming in languages supporting the functional paradigm to some extent, e.g. Scala, Kotlin (not to mention Haskell) jumped high, full of joy ‘Yay, we gonna have match or when, extracting data, guards, deconstructors in companion objects and more!’

Language selector