A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1537 below:

[java] Java 12 support · Issue #1537 · pmd/pmd · GitHub

Java 12 has entered Rampdown Phase, which means, the overall feature set is frozen and only bug fixing will occur.

Schedule: http://openjdk.java.net/projects/jdk/12/#Schedule
The planned general availability of Java 12 is 2019-03-19

Early Access builds for java 12 are available here: http://jdk.java.net/12/

There is one feature, that changes the language: JEP 325: Switch Expressions (Preview). It is a preview language feature, which means, it might be removed again - but it will be there at least for java 12.

The feature has 3 manifestations:

        switch (day) {
            case MONDAY, FRIDAY, SUNDAY: System.out.println("  6"); break;
            case TUESDAY               : System.out.println("  7"); break;
            case THURSDAY, SATURDAY    : System.out.println("  8"); break;
            case WEDNESDAY             : System.out.println("  9"); break;
        }
        switch (day) {
            case MONDAY, FRIDAY, SUNDAY -> System.out.println("  6");
            case TUESDAY                -> System.out.println("  7");
            case THURSDAY, SATURDAY     -> System.out.println("  8");
            case WEDNESDAY              -> System.out.println("  9");
        }
        int numLetters = switch (day) {
            case MONDAY, FRIDAY, SUNDAY -> 6;
            case TUESDAY                -> 7;
            case THURSDAY, SATURDAY     -> 8;
            case WEDNESDAY              -> 9;
            default                     -> {
                int k = day * 2;
                int result = f(k);
                break result;
            }
        };

Tasks:

Sample Code:
SwitchExpressions.java.txt


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4