To run each example use: java --enable-preview --source 14 <FileName.java>
- 305 - Pattern Matching for instanceof (Preview)
- 343 - Packaging Tool (Incubator)
- 345 - NUMA-Aware Memory Allocation for G1
- 349 - JFR Event Streaming
- 352 - Non-Volatile Mapped Byte Buffers
- 358 - Helpful NullPointerExceptions
- 359 - Records (Preview)
- 361 - Switch Expressions (Standard)
- 362 - Deprecate the Solaris and SPARC Ports
- 363 - Remove the Concurrent Mark Sweep (CMS) Garbage Collector
- 364 - ZGC on macOS
- 365 - ZGC on Windows
- 366 - Deprecate the ParallelScavenge + SerialOld GC Combination
- 367 - Remove the Pack200 Tools and API
- 368 - Text Blocks (Second Preview)
- 370 - Foreign-Memory Access API (Incubator)
- Switch Expressions
- Promotion to standard
- Text Blocks (second preview)
- added new flags
- Pattern Matching for
instanceof
(preview)- added as Preview
- Records (preview)
- added as Preview
- Notes:
- Does not have a
extends
clause, only extendsjava.lang.Record
; - Is implicitly final, thus cannot be extended;
- Cannot declare other fields and cannot contain instance initializers, it only contains its components declared at record header;
- Its components are final and cannot be updated via reflection (throw
IllegalAccessException
); - Cannot declare native methods;
- Local records is always static (local class and enum as never static).
- Does not have a
- JFR Event Streaming
- Here is a great example of a tool built
- Helpful NullPointerExpections
- flag to enable:
-XX:+ShowCodeDetailsInExceptionMessages
- flag to enable:
- Packaging tool to create self-contained Java applications
- bin:
jpackage
- bin: