跳到主要内容

JDK 14 新特性概览

JEP 305: Pattern Matching for instanceof (Preview)

Enhance the Java programming language with pattern matching for the instanceof operator. Pattern matching allows common logic in a program, namely the conditional extraction of components from objects, to be expressed more concisely and safely. This is a preview language feature in JDK 14.

JEP 305: instanceof 的模式匹配(预览)

通过为 instanceof 运算符增强 Java 编程语言的 模式匹配 功能。模式匹配 允许在程序中以更简洁和安全的方式表达常见逻辑,即从对象中有条件地提取组件。这是 JDK 14 中的一个 预览语言特性

JEP 343: Packaging Tool (Incubator)

Create a tool for packaging self-contained Java applications.

JEP 343: 打包工具 (孵化器)

创建一个用于打包自包含Java应用程序的工具。

JEP 345: NUMA-Aware Memory Allocation for G1

Improve G1 performance on large machines by implementing NUMA-aware memory allocation.

JEP 345: NUMA感知内存分配用于G1

通过实现NUMA感知内存分配,提升G1在大型机器上的性能。

JEP 349: JFR Event Streaming

Expose JDK Flight Recorder data for continuous monitoring.

JEP 349: JFR事件流

公开JDK Flight Recorder数据以进行持续监控。

JEP 352: Non-Volatile Mapped Byte Buffers

Add new JDK-specific file mapping modes so that the FileChannel API can be used to create MappedByteBuffer instances that refer to non-volatile memory.

JEP 352: 非易失性映射字节缓冲区

添加新的JDK特定文件映射模式,以便可以使用FileChannel API创建引用非易失性内存的MappedByteBuffer实例。

JEP 358: Helpful NullPointerExceptions

Improve the usability of NullPointerExceptions generated by the JVM by describing precisely which variable was null.

JEP 358: 有用的NullPointerExceptions

通过精确描述哪个变量为null,提高JVM生成的NullPointerException的可用性。

JEP 359: Records (Preview)

Enhance the Java programming language with records. Records provide a compact syntax for declaring classes which are transparent holders for shallowly immutable data. This is a preview language feature in JDK 14.

JEP 359: 记录 (预览)

通过 记录 增强 Java 编程语言。记录提供了一种紧凑的语法,用于声明作为浅不可变数据透明持有者的类。这是 JDK 14 中的一个 预览语言特性

JEP 361: Switch Expressions

Extend switch so it can be used as either a statement or an expression, and so that both forms can use either traditional case ... : labels (with fall through) or new case ... -> labels (with no fall through), with a further new statement for yielding a value from a switch expression. These changes will simplify everyday coding, and prepare the way for the use of pattern matching in switch. This was a preview language feature in JDK 12 and JDK 13.

JEP 361: Switch 表达式

扩展 switch 使其可以作为语句或表达式使用,并且两种形式都可以使用传统的 case ... : 标签(带有穿透)或新的 case ... -> 标签(不带穿透),并引入一个新的语句用于从 switch 表达式中返回值。这些变化将简化日常编码,并为在 switch 中使用模式匹配铺平道路。这是 JDK 12JDK 13 中的一个 预览语言特性

JEP 363: Remove the Concurrent Mark Sweep (CMS) Garbage Collector

Remove the Concurrent Mark Sweep (CMS) garbage collector.

JEP 363: 移除并发标记清扫(CMS)垃圾收集器

移除并发标记清扫(CMS)垃圾收集器。

JEP 364: ZGC on macOS (Experimental)

Port the ZGC garbage collector to macOS.

JEP 364: macOS上的ZGC(实验性)

将ZGC垃圾收集器移植到macOS。

JEP 365: ZGC on Windows (Experimental)

Port the ZGC garbage collector to Windows.

JEP 365: Windows上的ZGC(实验性)

将ZGC垃圾收集器移植到Windows。

JEP 366: Deprecate the ParallelScavenge + SerialOld GC Combination

Deprecate the combination of the Parallel Scavenge and Serial Old garbage collection algorithms.

JEP 366: 废弃 ParallelScavenge + SerialOld GC 组合

废弃 Parallel Scavenge 和 Serial Old 垃圾收集算法的组合。

JEP 367: Remove the Pack200 Tools and API

Remove the pack200 and unpack200 tools, and the Pack200 API in the java.util.jar package. These tools and API were deprecated for removal in Java SE 11 with the express intent to remove them in a future release.

JEP 367: 移除 Pack200 工具和 API

移除 pack200unpack200 工具,以及 java.util.jar 包中的 Pack200 API。这些工具和 API 在 Java SE 11 中被标记为待移除,明确表示将在未来的版本中移除。

JEP 368: Text Blocks (Second Preview)

Add text blocks to the Java language. A text block is a multi-line string literal that avoids the need for most escape sequences, automatically formats the string in a predictable way, and gives the developer control over the format when desired. This is a preview language feature in JDK 14.

JEP 368: 文本块(第二次预览)

向Java语言添加_文本块_。文本块是一个多行字符串字面量,避免了大多数转义序列的需要,自动以可预测的方式格式化字符串,并在需要时为开发者提供格式控制。这是JDK 14中的预览语言特性

JEP 370: Foreign-Memory Access API (Incubator)

Introduce an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap.

JEP 370: 外部内存访问API (孵化器)

引入一个API,允许Java程序安全且高效地访问Java堆外的外部内存。