The preface

👁 follow wechat public account: atypical Science male reply: jdk14 Get all the articles about the new features of JDk14.

JDK14 is released

JDK14 was officially released on March 17, 2020.

JDK14 will receive security updates in April and July, then be replaced by the non-LTS version of JDK 15 that expires in September. JDK14 includes 16 new features such as JDK Flight Recorder event flow, pattern matching and switch expressions.

Since JDK9, Oracle has adopted a new release cycle: release every 6 months and LTS release every 3 years. JDK14 is the fourth non-LTS release after JDK9. The latest LTS release is JDK11.

JDK14 new features

JDK14 contains more features than JDK12 and JDK13 combined. Includes 16 new features.

New language features

Includes 7 new features, including 3 formal features and 7 informal features.

Switch Expressions

Switch Expressions was previewed in JDK 12 and 13 and is now a stable feature in JDK 14. The switch expression extends the switch statement so that it can be used as both a statement and an expression, and both can be written using traditional Switch syntax. Or use the simplified “case L ->” pattern matching syntax to work on different scopes and control the flow of execution. These changes will simplify everyday coding and prepare you for pattern matching in switch

Improved NullPointerExceptions

Improved NullPointerExceptions to improve the availability of JVM-generated exceptions by accurately describing which variables are NULL. The authors of the proposal hope to provide developers and support staff with useful information about why programs terminate abnormally, and to improve understanding of programs by more clearly associating dynamic exceptions with static program code.

Byte buffering for non-volatile mappings

Byte buffers for non-volatile maps add a new JDK specific file mapping mode that allows the FileChannel API to be used to create MappedByteBuffer instances that reference non-volatile memory (NVM).

Records the grammar (Preview)

Records provides a compact syntax for declaring classes that are transparent owners of shallowly immutable data to help developers write more concise code. This feature is primarily used for domain-specific classes that are primarily used to hold data and do not provide domain-specific behavior.

Introducing pattern matching for the Instanceof operator (Preview)

With pattern matching, developers can express common program logic in a more concise and secure way. Pattern matching for the Instanceof operator enables conditional extraction of components from objects, a language feature currently in the preview phase.

Text Block Features (Second Preview)

Text Blocks, like the common Python””” “any input””” feature, supports multi-line string literals-without the need for most escape sequences, and automatically formats strings in a predictable manner, while giving developers control over formatting. While this is not a particularly complicated feature, it is a great convenience for developers who want to introduce HTML code into Java, and greatly improves code readability. It is currently in the second preview phase.

External Memory access API (Incubation phase)

A new API is added to allow Java programs to safely and efficiently access external memory outside the Java heap.

Garbage collection modification

A total of six new features are in the official state.

Numa-aware memory allocation for G1

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

JFR event flow

Expose JDK Flight Recorder data for continuous monitoring.

Remove some garbage collectors

  • Remove the CMS garbage collector
  • Discard the ParallelScavenge + SerialOld GC garbage collection algorithm combination

ZGC garbage collection supports macOs and Windows platforms

Port the ZGC garbage collector to macOS and Windows platforms.

Remove packages and features

Two new features are included.

  • Delete the Pack200 tool and API
  • Deprecate Solaris and SPARC ports

A new tool

Includes 1 new feature. In the incubation state.

Packaging tools (Incubation phase)

Create a tool for packaging standalone Java applications.

All Features summary

The full new features are as follows:

  • 305: Instanceof Pattern Matching (Preview)

  • 343: Packaging Tools (incubator)

  • 345: NUMA aware memory allocation for G1

  • 349: JFR event flow

  • 352: non-volatile mapped byte buffer

  • 358: Useful NullPointerExceptions

  • 359: Record (preview)

  • 361: Switching expressions (standard)

  • 362: Deprecates Solaris and SPARC ports

  • 363: Remove concurrent mark scan (CMS) garbage collector

  • 364: ZGC on Mac OS you like

  • 365: ZGC on Windows

  • Avenge + SerialOld GC

  • 367: Deletes the Pack200 tool and API

  • 368: Text block (second preview)

  • 370: External Memory access API (Incubator)

What is architectural design? Architecture Design This article is enough

Why is Redis so fast?

Blockbuster: The latest JVM ecology report for 2020

BIO, NIO, AIO summary

How much do you know about the new features of JDK8?

Reply to “Information” and get an exclusive technical information for free!

What is architectural design? Architecture Design This article is enough

Why is Redis so fast?

Blockbuster: The latest JVM ecology report for 2020

BIO, NIO, AIO summary

How much do you know about the new features of JDK8?

Reply to “Information” and get an exclusive technical information for free!