diff --git a/core-java-modules/core-java-15/pom.xml b/core-java-modules/core-java-15/pom.xml
index df8aeafca9..c6f1454078 100644
--- a/core-java-modules/core-java-15/pom.xml
+++ b/core-java-modules/core-java-15/pom.xml
@@ -51,8 +51,8 @@
${maven.compiler.release}
--enable-preview
-
- 14
+
+ 15
diff --git a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/records/Person.java b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/records/Person.java
index e59fa86ed6..67d3151440 100644
--- a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/records/Person.java
+++ b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/records/Person.java
@@ -3,13 +3,15 @@ package com.baeldung.whatsnew.records;
/**
* Java record with a header indicating 2 fields.
*/
-public record Person(String name, int age) {
-
+public record Person(String name, int age)
+{
/**
* Public constructor that does some basic validation.
*/
- public Person {
- if (age < 0) {
+ public Person
+ {
+ if (age < 0)
+ {
throw new IllegalArgumentException("Age cannot be negative");
}
}
diff --git a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Employee.java b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Employee.java
index e9a2e25417..72ef75cb7c 100644
--- a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Employee.java
+++ b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Employee.java
@@ -2,12 +2,10 @@ package com.baeldung.whatsnew.sealedclasses;
import java.util.Date;
-public non-sealed class Employee extends Person {
-
+public non-sealed class Employee extends Person
+{
public Date getHiredDate()
{
return new Date();
}
-
-
}
diff --git a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Manager.java b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Manager.java
index 79c50b057e..87cbcf2673 100644
--- a/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Manager.java
+++ b/core-java-modules/core-java-15/src/main/java/com/baeldung/whatsnew/sealedclasses/Manager.java
@@ -1,4 +1,5 @@
package com.baeldung.whatsnew.sealedclasses;
-public final class Manager extends Person {
+public final class Manager extends Person
+{
}