Skip to content

Commit e211b88

Browse files
committed
JDK 21: update JPEs
1 parent 13ca9d8 commit e211b88

8 files changed

+26
-6
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A project to explore more about the new features from Java 8 through Java 21.
1111

1212
## Resume by Version
1313

14-
* [Java 21](java-21/)
14+
* [Java 21](java-21/) (LTS)
1515
* Virtual Threads (standard) :rocket:
1616
* Record Pattern (standard) :rocket:
1717
* Pattern Matching for `switch` (standard) :rocket:
@@ -20,6 +20,8 @@ A project to explore more about the new features from Java 8 through Java 21.
2020
* Foreign Function & memory API (preview 3)
2121
* Unnamed Patterns and Variables (preview)
2222
* Unnamed Classes and Instance Main Methods (preview)
23+
* Prepare to Disallow the Dynamic Loading of Agents
24+
* KEM API
2325

2426
* [Java 20](java-20/) (Mar, 2023)
2527
* Scoped values (incubator)
@@ -43,7 +45,7 @@ A project to explore more about the new features from Java 8 through Java 21.
4345
* Pattern matching for `switch` (preview 2)
4446
* Deprecated method `finalize`
4547

46-
* [Java 17](java-17/) (Sep, 2021)
48+
* [Java 17](java-17/) (LTS; Sep, 2021)
4749
* Sealed classes (standard)
4850
* Pattern matching for `switch` (preview)
4951
* Enhanced Pseudo-Random Number Generator
@@ -97,7 +99,7 @@ A project to explore more about the new features from Java 8 through Java 21.
9799
* CDS enable by default
98100
* New GC and improvements
99101

100-
* [Java 11](java-11/) (Sep, 2018)
102+
* [Java 11](java-11/) (LTS; Sep, 2018)
101103
* Removal of Java EE Modules, JavaFX and deprecated API
102104
* Http Client (incubator)
103105
* var in lambda expressions

java-21/InstanceMainMethodLauncher.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class InstanceMainMethod {
1+
/**
2+
* To run: `java --enable-preview --source 21 InstanceMainMethodLauncher.java`
3+
*/
4+
class InstanceMainMethodLauncher {
25
void main() {
36
System.out.println("Hello world from an instance main method o/");
47
}

java-21/PatternMatchingForSwitchTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import java.util.*;
22

3+
/**
4+
* To run: `java PatternMatchingForSwitchTest.java`
5+
*/
36
public class PatternMatchingForSwitchTest {
47
public static void main(String[] args) {
58
switchExhaustivenessAndCompatibility();

java-21/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ To run each example use: `java --enable-preview --source 21 <FileName.java>`
1616
* [445](https://openjdk.org/jeps/445) - Unnamed Classes and Instance Main Methods (Preview)
1717
* [448](https://openjdk.org/jeps/448) - Vector API (Sixth Incubator)
1818
* [449](https://openjdk.org/jeps/449) - Deprecate the Windows 32-bit x86 Port for Removal
19+
* [451](https://openjdk.org/jeps/451) - Prepare to Disallow the Dynamic Loading of Agents
20+
* [452](https://openjdk.org/jeps/452) - Key Encapsulation Mechanism API
1921

2022
## Features
2123

java-21/RecordPatternTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.*;
22

33
/**
4-
* To run: `java RecordsPatternSecondPreviewTest.java`
4+
* To run: `java RecordPatternTest.java`
55
*/
66
public class RecordPatternTest {
77
public static void main(String[] args) {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
/**
2+
* To run: `java --enable-preview --source 21 UnnamedClassMainMethodLauncher.java`
3+
*/
24
void main() {
35
System.out.println("Hello world from a unnamed class with a main method o/");
46
}

java-21/UnnamedClassWithAllowedMembers.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* To run: `java --enable-preview --source 21 UnnamedClassWithAllowedMembers.java`
3+
*/
4+
15
static String staticField = "can have static field";
26
static String privateStaticField = "can have private static field";
37

java-21/UnnamedClassWithInitializers.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* To run: `java --enable-preview --source 21 UnnamedClassWithInitializers.java`
3+
*/
4+
15
static {
26
System.out.println("static initializer");
37
}

0 commit comments

Comments
 (0)