Language selector

Java 16

Modern Java is really awesome when it comes to “Hello, World!” demos. It’s also cool for a sophisticated systems and algorithms, provided their authors write code which obeys a few fairly simple contracts and avoids obvious traps. There are a few mantras regarding recent features of modern Java, such as: records can replace JavaBeans everywhere you never need to write hashCode() for records pattern matching with instanceof is the best tool for equals() just ignore --illegal-access and set it to permit synchronize (new Long(42)) is the best for monitoring and so on.
Many features and changes we see coming live in new Java version (if not most of them) are developed under so-called umbrella projects. We frequently see syntax improvements from project Amber, project Jigsaw is about bringing modules, project Loom (surprise, surprise) is about new threads, project Panama roughly speaking is about using native stuff safely and efficiently, and among the most known ones, project Valhalla starts to become a thing, thanks to JEP-390 being included in Java 16.
Last year I wrote two posts about torturing Java records with Lombok. Fortunately (or not, depends on your point of view), Lombok’s team decided to end these sick plays. However, we don’t give up and go for builder!
Another (half a) year has passed, another major Java™ version has been released. Java was supposed “to be slow”. However, Java turns out to evolve so fast, that next releases aren’t just version bumps, but might significantly change the rules of the game. That’s a good reason to check out what’s new in Java. We’re going to cover: Records, where and how to use them, apart from DTO/VO Pattern matching with instanceof A.
In the dark ages, we had to wait for 3-4 years to see the new Java version with some new features. Now there are two major releases every year! Can we benefit from the new features before the next LTS release? We don’t have to wait 3 years or so for new features any more. Isn’t that cool? 😉 So… you’d like to check what has happened since Java 11? Record types?

Language selector