Add java21-features module: runnable demos and captured output for the ankurm.com java21-features article

This commit is contained in:
2026-10-20 17:13:59 +00:00
parent 5a076c826f
commit c3cc57f482
33 changed files with 354 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# java21-features — Java 21 features with examples
Companion code for the ankurm.com article **Java 21 Features with Examples: Virtual Threads, Record Patterns, Sequenced Collections**. The explanation lives in the article; this folder holds the runnable sources and the transcripts they produced. There is no `docs/` folder: the depth is inside the article itself.
```bash
JDK21=/path/to/jdk21 ./run.sh # regenerates output/*.txt
```
- `src/` compiles and runs unchanged on the JDK named in each output header.
- `broken/` fails to compile on purpose; the compiler's own message is committed in `output/`.
- `output/` is real captured output, regenerated by `run.sh`.
Tested on: OpenJDK 21.0.12.1 (the preview and incubator demos need --enable-preview / --add-modules, which run.sh passes).