Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Core Java Features
This repository contains Java examples that are designed to track and document the progress of Java Enhancement Proposals (JEPs), Java Specification Requests (JSRs), and Java Language Revisions (JLRs). These examples provide a comprehensive overview of the various changes, updates, and improvements made to the Java language and platform over time.

![image](/docs/diagrams/jdk22-diagram.PNG)
![image](/docs/diagrams/jdk24-diagram.PNG)

****Note***: Continuous improvements and bug fixes are made within the repository to produce better solutions.*

Expand Down
Binary file added docs/diagrams/jdk24-diagram.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions java-24/src/main/java/JEP492FlexibleConstructorBodies.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
public class JEP492FlexibleConstructorBodies {
public static void main(String[] args) {

}
}

class Person {
private final String name;
private final int age;

Person(String name, int age) {
prologue {
if (name == null || name.isBlank()) {
throw new IllegalArgumentException("Name cannot be empty");
}
if (age < 0) {
throw new IllegalArgumentException("Age cannot be negative");
}
}
this.name = name;
this.age = age;

epilogue {
System.out.println("Person object created: " + name + ", Age: " + age);
}
}
}
Loading