Java 12 Overview


Java 12 is an important feature launch and it has come up with many language-specific replacements to JAVA. It came after the Java launch cadence initiated Java 10 ahead and it came up in March 2019, It is launched just after six months of java 11 launches.

Java 12 is a non-LTS launch.

New Features

Many new features that are introduced in Java 12, are given below:

  • JVM Changes − JEP 189, JEP 346, JEP 344, and JEP 230.
  • Switch Expressions − A preview attribute permitting switch to use a lambda expression.
  • File.mismatch() method − File Comparison can be easily made via the mismatch method.
  • Compact Number Formatting − Numbers can be edited simply like 2K, 3M, etc.
  • Teeing Collector in Stream API − A merging operator on many different collectors.
  • String new methods − four new ways introduced to format a string.
  • JEP 334 − JVM Constants API launched.
  • JEP 305 − A preview attribute permits pattern matching for instance.

Java 12 improved many APIs with new ways and options.