JDK 13 新特性概览
JEP 350: Dynamic CDS Archives
Extend application class-data sharing to allow the dynamic archiving of classes at the end of Java application execution. The archived classes will include all loaded application classes and library classes that are not present in the default, base-layer CDS archive.
JEP 350: 动态CDS归档
扩展应用程序类数据共享,允许在Java应用程序执行结束时动态归档类。归档的类将包括所有已加载的应用程序类和不在默认基础层CDS归档中的库类。
JEP 351: ZGC: Uncommit Unused Memory (Experimental)
Enhance ZGC to return unused heap memory to the operating system.
JEP 351: ZGC: 释放未使用的内存(实验性)
增强ZGC以将未使用的堆内存返回给操作系统。
JEP 353: Reimplement the Legacy Socket API
Replace the underlying implementation used by the java.net.Socket
and java.net.ServerSocket
APIs with a simpler and more modern implementation that is easy to maintain and debug. The new implementation will be easy to adapt to work with user-mode threads, a.k.a. fibers, currently being explored in Project Loom.
JEP 353: 重新实现传统Socket API
用一个更简单、更现代的实现替换java.net.Socket
和java.net.ServerSocket
API所使用的底层实现,以便于维护和调试。新的实现将易于适应用户模式线程(即纤程),目前正在Project Loom中进行探索。
JEP 354: Switch Expressions (Second Preview)
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 (JEP 305) in switch
. This is a preview language feature in JDK 13.
JEP 354: Switch表达式(第二次预览)
扩展switch
,使其可以用作语句或表达式,并且两种形式都可以使用传统的case ... :
标签(带有穿透)或新的case ... ->
标签(无穿透),并为从switch
表达式中生成值引入一个新的语句。这些更改将简化日常编码,并为在switch
中使用模式匹配(JEP 305)做好准备。这是JDK 13中的预览语言特性。
JEP 355: Text Blocks (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 format when desired. This is a preview language feature in JDK 13.
JEP 355: 文本块(预览)
在Java语言中添加_文本块_。文本块是一种多行字符串字面量,可以避免大多数转义序列的需要,自动以可预测的方式格式化字符串,并在需要时给予开发者对格式的控制。这是JDK 13中的预览语言特性。