Java – How to enable the preview language features?

This article shows you how to use –enable-preview to enable the preview language features in Java 12, 13 and above. Note Read this JEP 12: Preview Language and VM Features P.S All preview features are disabled by default. On JDK 12: # compile javac Example.java // Do not enable any preview features javac –release 12 …

Read more

Java 13 – Switch Expressions

In Java 13, the JEP 354: Switch Expressions extends the previous Java 12 Switch Expressions by adding a new yield keyword to return a value from the switch expression. P.S Switch expressions are a preview feature and are disabled by default. Note This is a standard feature in Java 14. 1. No more value breaks! …

Read more

What is new in Java 13

Java 13 reached General Availability on 17 September 2019, download Java 13 here or this openJDK archived. Java 13 features. 1. JEP 350 Dynamic CDS Archives 2. JEP 351 ZGC: Uncommit Unused Memory 3. JEP-353 Reimplement the Legacy Socket API 4. JEP-354 Switch Expressions (Preview) 5. JEP-355 Text Blocks (Preview) Java 13 developer features. Switch …

Read more