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
+8
View File
@@ -0,0 +1,8 @@
import java.lang.management.*;
/** JEP 439 (final): Generational ZGC is opt-in on 21 with -XX:+ZGenerational. Prints the GC beans each mode registers. */
public class GcNamesDemo {
public static void main(String[] args) {
for (GarbageCollectorMXBean b : ManagementFactory.getGarbageCollectorMXBeans()) System.out.println("gc bean : " + b.getName());
}
}