Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.12 KB

File metadata and controls

41 lines (28 loc) · 1.12 KB

Java 13 Features

Released on September 17, 2019.

1. Text Blocks (Preview) JEP 355

Text Blocks become a preview feature in Java 15

2. Switch Expressions Enhancements JEP 354

Switch Expressions (Preview) Introduced in Java 12 as a preview feature.

  • The word break is no longer needed in switch expressions. It replaced by yield.

2.1. Switch expressions : yield

String result = switch (day) {
    case "1" -> "Monday";
    case "2" -> "Tuesday";
    case "3" -> "Wednesday";
    case "4" -> "Thursday";
    case "5" -> "Friday";
    case "6" -> "Saturday";
    case "7" -> "Sunday";
    default -> {
        System.out.println("Invalid day");
        yield "Invalid day"; // yield is used to return a value 
    }
};

Switch Expressions

3. Reimplement the Legacy Socket API

4. ZGC: Uncommit Unused Memory

5. FileSystems.newFileSystem() Method

6. DOM and SAX Factories with Namespace Support