Call for feedback -- switch expressions in JDK 12

Alex Buckley alex.buckley at oracle.com
Thu Feb 27 18:04:38 UTC 2020


Thanks Andy, glad to hear you've been using Java 12 and 13, and switch 
expressions in particular. They'll be a standard feature in Java 14, 
unchanged since Java 13 (see JEP 361 for the history).

Alex

On 2/27/2020 12:36 AM, Andy Fendley wrote:
> Hi Alex,
> 
> Been using the new switch expressions in Java 12 and 13 for a bit and really like them. They cut code down code, get rid of break and the expression capability is useful. One issue I have, is that if I need more than one line of code for each case I have to enclose in a block which makes the code really ugly and worse to be honest. Using the old method this was not the case.
> 
> Hope this helps.
> 
> Andy


More information about the jdk-dev mailing list