Java 12 - Overview



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

Java 12 is a non-LTS release.

New Features

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

  • JVM Changes − JEP 189, JEP 346, JEP 344, and JEP 230.

  • Switch Expressions − A preview feature allowing switch to use lambda expression.

  • File.mismatch() method − File Comparison is made easy via mismatch method.

  • Compact Number Formatting − Numbers can be formatted like 2K, 3M etc easily.

  • Teeing Collector in Stream API − A merging operator on multiple collectors.

  • String new methods − four new methods introduced to format a string.

  • JEP 334 − JVM Constants API introduced.

  • JEP 305 − A preview feature allowing pattern matching for instanceOf.

Java 12 enhanced numerous APIs with new methods and options. We'll see these changes in next chapters.

Advertisements