Switch Expressions comes with Java 12

Switch Expressions comes with Java 12

Java 12, the latest six-monthly release of Java, has been released with support for Switch Expressions and the inclusion of the Shenandoah low-pause garbage collector.  There are eight main improvements to the new release, starting with switch expressions. This is still a preview feature, and it extends the switch statement so that it can be used as either a statement or an expression. Whichever form is used, you can use either a traditional or a simplified scoping and control flow behavior. Oracle says that in addition to simplifying everyday coding, the addition prepares the way for the use of pattern matching in the switch statement. Pattern matching is available as another…

Continue reading... Switch Expressions comes with Java 12