Java 13 Features and Release Date Finalized

Author: Shazin Sadakath

We have talked about Java in countless previous posts and today we are going to share the good news of release of the latest Java version to come out of Oracle, Java 13. The JDK 13 has entered Feature Freeze and Rampdown phase and is expected to release General Availability on September 2019.

The final features list for Java 13 includes the following; 

The Switch Expressions which was previewed in Java 12 (discussed in this post) has gone through a community comments and now introduces a new keyword called yield. The yield keyword can be considered as the return keyword of the new switch expression. Where there is a code block associated with a case of a switch expression the new yield keyword can be used to return the value at the end of the block. For Example:

int j = switch (day) {
    case MONDAY  -> 0;
    case TUESDAY -> 1;
    default      -> {
        int k = day.toString().length();
        int result = f(k);
        yield result;

Yield keyword can also be used as following;

int result = switch (s) {
    case "Foo": 
        yield 1;
    case "Bar":
        yield 2;
        System.out.println("Neither Foo nor Bar, hmmm...");
        yield 0;

The Text Blocks feature was also previewed in Java 12 as Multiline Strings. It is about time we get used to the features and familiarize ourselves so that we can be ready during the official release later this year.

Tags: Java13 Yield Java Oracle Release
Views: 903
Register for more exciting articles


Please login or register to post a comment.

There are currently no comments.