Runnable sources, broken examples and captured transcripts for the ankurm.com JEP 513 article, including the JDK 25 vs 27 compiler wording differences. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
10 lines
447 B
Plaintext
10 lines
447 B
Plaintext
$ javac src/BeforeJava25.java && java BeforeJava25 (OpenJDK Runtime Environment Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS))
|
|
Person constructor ran for 'Asha'
|
|
name='Asha' salary=50000
|
|
caught: salary must be >= 0, got -1
|
|
|
|
$ javac src/BeforeJava25.java && java BeforeJava25 (OpenJDK Runtime Environment (build 21.0.10+7-Ubuntu-124.04))
|
|
Person constructor ran for 'Asha'
|
|
name='Asha' salary=50000
|
|
caught: salary must be >= 0, got -1
|