Add jep512 module: compact source files and instance main methods on JDK 25 and 27

Runnable sources, broken examples and captured transcripts for the ankurm.com JEP 512 article,
including the measured launch order and a private-constructor difference between 25 and 27.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
This commit is contained in:
Claude
2026-09-24 10:32:47 +00:00
parent 6b5a918278
commit e0cb6e83e2
34 changed files with 490 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
class CtorWithArgs {
CtorWithArgs(int x) {}
void main() { IO.println("instance main, but no zero-argument constructor"); }
}
+3
View File
@@ -0,0 +1,3 @@
void main() {
println("hello");
}
+1
View File
@@ -0,0 +1 @@
void greet() { IO.println("hi"); }
+4
View File
@@ -0,0 +1,4 @@
void main() {
HttpClient client = HttpClient.newHttpClient();
IO.println(client);
}
+4
View File
@@ -0,0 +1,4 @@
void main() {
Target t = new Target();
t.main();
}
+4
View File
@@ -0,0 +1,4 @@
class PrivateCtor {
private PrivateCtor() {}
void main() { IO.println("instance main() reached through a PRIVATE zero-argument constructor"); }
}
+3
View File
@@ -0,0 +1,3 @@
class PrivateMain {
private static void main() { IO.println("private static main"); }
}
+1
View File
@@ -0,0 +1 @@
void main() { IO.println("Target"); }
+5
View File
@@ -0,0 +1,5 @@
package demo;
void main() {
IO.println("a package declaration in a compact file");
}
+1
View File
@@ -0,0 +1 @@
void main(int count) { IO.println("count = " + count); }