Java 23 has arrived! It’s been six months since Java 22 was released, so it’s time for a fresh truckload of JEPs. In this article, we take you on a tour of everything that is part of this release, giving …
-
Java 22 Is Here, And It’s Ready To Rock
Java 22 is here, and it’s ready to rock! Boasting a set of 12 JEPs, it finalizes features like ‘unnamed variables and patterns’ and previews new ones like ‘statements before super(…)’ and ‘stream gatherers’ .
-
Java 21 is Available Today, And It’s Quite the Update
Today’s the first day of Java 21’s availability! It’s been six months since Java 20 was released, so it’s time for another fresh wave of Java features.
-
Exploring Java Records In A Jakarta EE Context
This article explores the adoption of Java Records in a Jakarta EE application as a data transfer and projection object.
-
It’s Java 20 Release Day! Here’s What’s New
In this article, we will take you on a tour through all JEPs that come with this release and give you a brief introduction of each one of them.
-
How to Best Use Java Records as DTOs in Spring Boot 3
Explore how to best use compact Java Records as Data Transfer Objects (DTOs) for database and API calls in Spring Boot 3 with Hibernate 6 as the persistence provider.
-
Foojay Podcast #5: OpenJDK 19 Discussion Panel
It’s September 20th, OpenJDK 19 has been released. In this podcast, we discuss the new features and the changes that this release brings.
-
What Can We Expect In OpenJDK 19?
Although the Java 19 release is coming in September (2022-09-20), we already know what will happen in that release!
-
Avoid Multithreading Bugs Using Immutable Java 16 Records
In a multi-threaded Java application, any thread can change the state of an object.
The Java memory model in Java language specification specifies when exactly updates made by one thread are going to be visible to other threads.
This is one of the biggest problems professional Java developers deal with every day.
Java records are immutable. An object is considered immutable if its state cannot change after it is constructed. The immutable nature of records eliminates problems of its usage in a multithreaded environment.
-
Java 16 and IntelliJ IDEA
If you are still working with Java 8, you might have mixed feelings about the news of the release of Java 16. However, you’ll see these numbers are going to increment at a much faster and predictable rate with Java’s six-month release cadence.
I’m personally excited about Java 16! It adds Records and Pattern Matching for instanceof as standard language features with Sealed classes continuing to be a preview feature (in the second preview).
Fun fact – Records was voted the most popular Java 16 language feature by 1158 developers in this Twitter poll, with Pattern Matching for instanceof second.
In this blog post, I will limit coverage of Java 16 to its language features, why you need them, and how you can start using them in IntelliJ IDEA. You can use this link for a comprehensive list of the new Java 16 features. Let’s get started.
-
Java 16 Records: Data Carrier Classes
Professional Java developers need immutable data carrier-classes for communication with databases and web Services. We need to write a lot of boilerplate code to create a simple data carrier-class, we typically implement constructor, accessors, equals(), hashCode(), and toString(). This process is repetitive and error-prone. Developers also complain “Java is too verbose”.
Record classes provide a way to model data in Java. An example of data is a row in a database table. This feature simplifies coding, makes Java code more concise and readable, increasing productivity for professional Java developers. Java14 introduced Records as a preview feature, Java15 brings in some updates as a second preview, and Java16 makes it a final feature, no changes will be needed for Records after this.