Files
javademos/jep513/output/01-validate-before-super.txt
Claude 2ebea58d39 Add jep513 module: flexible constructor bodies on JDK 25 and 27
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
2026-09-24 10:42:36 +00:00

14 lines
623 B
Plaintext

$ javac src/ValidateBeforeSuper.java && java ValidateBeforeSuper (OpenJDK Runtime Environment Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS))
valid input:
Person constructor ran for 'Asha'
name='Asha' salary=50000
invalid input:
caught: salary must be >= 0, got -1 (note: no 'Person constructor ran' line above)
$ javac src/ValidateBeforeSuper.java && java ValidateBeforeSuper (OpenJDK Runtime Environment Temurin-27+35 (build 27+35))
valid input:
Person constructor ran for 'Asha'
name='Asha' salary=50000
invalid input:
caught: salary must be >= 0, got -1 (note: no 'Person constructor ran' line above)