Java 简明教程

Java 13 - New Features

Java 13 是一个主打新特性的版本,它为 Java 带来了许多针对 JVM 的改动,以及一些针对语言的改动。它遵循了从 Java 10 开始推出的 Java 发布节奏,并在 Java 12 发布仅 6 个月之后的 2019 年 9 月发布。

Java 13 is a major feature release and it has brought many JVM specific changes to JAVA and few language specific changes. It followed the Java release cadence introduced Java 10 onwards and it was releasd on Sept 2019, just six months after Java 12 release.

Java 13 是一个非 LTS 版本。

Java 13 is a non-LTS release.

New Features in Java 13

以下是 Java 13 中引入的主要新特性。

Following are the major new features which are introduced in Java 13.

  1. JEP 354 - Switch Expressions - A preview feature allowing switch to use return values via yield.

  2. JEP 355 - Text Blocks - A preview feature to handle multiline strings like JSON, XML easily.

  3. String new methods - New Methods added to string to handle text blocks.

  4. JEP 353 - Socket API Reimplementation - Underlying API is rewritten.

  5. FileSystems.newFileSystem() - Three new methods added to make it easy to use.

  6. DOM/SAX Factories - New methods added to add namespace support.

  7. Dynamic CDS Archive - CDS archive can be created easily.

  8. JEP 351 - ZGC Enhancements - ZGC enhanced to return unused heap memory to operating system.

Java 13 为 java.nio.file.FileSystems 引入了三个新方法,以便轻松地将文件的内容当作文件系统处理。

Java 13 have introduced three new methods to java.nio.file.FileSystems to treat the content of a file as a file system easily.

  1. newFileSystem(Path)

  2. newFileSystem(Path, Map<String, ?>)

  3. newFileSystem(Path, Map<String, ?>, ClassLoader)

以下是添加到语言中的其他主要变更。

Following are other major changes added to language.

  1. java.time – Japanese era name added

  2. javax.crypto – MS Cryptography Next Generation (CNG)support

  3. javax.security – jdk.sasl.disabledMechanisms property added disabling SASL mechanisms

  4. javax.xml.crypto – String constants introduced to represent Canonical XML 1.1 URIs

  5. javax.xml.parsers – Methods added to instantiate DOM and SAX factories for namespaces support

  6. Unicode support is upgraded to version 12.1

  7. Kerberos principal name canonicalization support added, cross-realm referrals are supported.

API marked for Removal

  1. SocketImpl implementations prior to JDK 1.4

  2. javax.security.cert API

  3. rmic

  4. javadoc tool old features

以下链接中可获得其他详细信息 APIs proposed for removal.

Other details are available at following link − APIs proposed for removal.