Return to site

New language features in Java 17

· java

In the middle of September, Java 17 got released. This is the new LTS (Long Term Support) version, replacing Java 11. In this article I am going over the changes in the language that happened since Java 11. Java is definitely still on the move and in more than one direction.

―𝐒𝐰𝐢𝐭𝐜𝐡 𝐞𝐱𝐩𝐫𝐞𝐬𝐬𝐢𝐨𝐧𝐬

―𝐓𝐞𝐱𝐭 𝐛𝐥𝐨𝐜𝐤𝐬

―𝐑𝐞𝐜𝐨𝐫𝐝𝐬

―𝐢𝐧𝐬𝐭𝐚𝐧𝐜𝐞𝐨𝐟 𝐩𝐚𝐭𝐭𝐞𝐫𝐧 𝐦𝐚𝐭𝐜𝐡𝐢𝐧𝐠

―𝐒𝐞𝐚𝐥𝐞𝐝 𝐜𝐥𝐚𝐬𝐬𝐞𝐬

―𝐏𝐚𝐭𝐭𝐞𝐫𝐧 𝐦𝐚𝐭𝐜𝐡 𝐟𝐨𝐫 𝐬𝐰𝐢𝐭𝐜𝐡

𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧

Since the last LTS, Java has seen many language improvements. While some of these are more standalone there is definitely a coherence discoverable between switch pattern matching, sealed classes and records.

Oracle has recently decided that it will release an LTS version every two years from now on. This used to be three years. So the next LTS version will be Java 21.

With so many new and exciting features added to the language you should feel encourages to upgrade your existing projects to the latest Java version.

The code examples in this article plus some additional examples can be found in my GitHub repository.