Language selector

Posts

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!’

Below you can find a piece of code written in Java. I’d like to ask you one thing: please don’t run this code before you try to answer.

Language selector