Language selector

value-based classes

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.
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.

Language selector