HTTPS SSH

Java 12 Preview: Switch Statement (JEP-325)

A preview of the next step to pattern matching for Java (TM) with the new switch statement (JEP-325).

Compiling

Preview features must be enabled to compile the code:

javac -source 12 --enable-preview com/hascode/tutorial/ExampleWithNewSwitch.java

Tutorial

Please feel free to visit my blog at www.hascode.com for the full examples.


2018 Micha Kops / hasCode.com