File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
java-22/src/main/java/com/ibrahimatay Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This repository contains Java examples that are designed to track and document t
8
8
## Specifications & Practices
9
9
10
10
* [ Java 22] ( java-22 ) (March, 2024)
11
+ * [ JEP 458] ( java-22/src/main/java/com/ibrahimatay/JEP458LaunchMultiFileSourceCode.java ) : Launch Multi-File Source-Code Programs]
11
12
12
13
* [ Java 21] ( java-21 ) (September, 2023)
13
14
* [ JEP 430] ( java-21/src/main/java/com/ibrahimatay/JEP430StringTemplates.java ) : String Templates
Original file line number Diff line number Diff line change
1
+ package com .ibrahimatay ;
2
+
3
+ // JEP 458: Launch Multi-File Source-Code Programs
4
+ // https://openjdk.org/jeps/458
5
+
6
+ // JEP draft: Launch Multi-File Source-Code Programs
7
+ // https://www.reddit.com/r/java/comments/11u1w17/jep_draft_launch_multifile_sourcecode_programs/
8
+
9
+ // java --enable-preview --source 22 JEP458LaunchMultiFileSourceCode.java
10
+
11
+ public class JEP458LaunchMultiFileSourceCode {
12
+ static {
13
+ System .out .println ("LaunchMultiFileSourceCodeProgramMain static initializer" );
14
+ }
15
+
16
+ void main () {
17
+ System .out .println ("Here the launcher will compile and load the other Java file" );
18
+ var value = LaunchMultiFileSourceCodeHelper .generateValue ();
19
+ System .out .println ("Value: " + value );
20
+ }
21
+ }
22
+
23
+ class LaunchMultiFileSourceCodeHelper {
24
+ static {
25
+ System .out .println ("LaunchMultiFileHelper static initializer" );
26
+ }
27
+
28
+ public static int generateValue () {
29
+ return 42 ;
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments