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

This commit is contained in:
2026-10-20 17:13:58 +00:00
parent 8b9447a393
commit 5a076c826f
23 changed files with 261 additions and 0 deletions
@@ -0,0 +1,5 @@
/** Fails on 17 without --enable-preview: pattern matching for switch is only a preview feature in 17 (JEP 406). */
public class SwitchPatternOn17 {
static String f(Object o) { return switch (o) { case String s -> "string"; default -> "other"; }; }
public static void main(String[] args) { System.out.println(f("x")); }
}