Skip to content

Commit dc89d6a

Browse files
authored
Merge pull request #5 from ibrahimatay/java-24
jdk24 diagram
2 parents 9d36a1f + a458b5e commit dc89d6a

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Core Java Features
44
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.
55

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

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

docs/diagrams/jdk24-diagram.PNG

378 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class JEP492FlexibleConstructorBodies {
2+
public static void main(String[] args) {
3+
4+
}
5+
}
6+
7+
class Person {
8+
private final String name;
9+
private final int age;
10+
11+
Person(String name, int age) {
12+
prologue {
13+
if (name == null || name.isBlank()) {
14+
throw new IllegalArgumentException("Name cannot be empty");
15+
}
16+
if (age < 0) {
17+
throw new IllegalArgumentException("Age cannot be negative");
18+
}
19+
}
20+
this.name = name;
21+
this.age = age;
22+
23+
epilogue {
24+
System.out.println("Person object created: " + name + ", Age: " + age);
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)