NewsSwitch Expressions Coming to JDK 12

Switch Expressions Coming to JDK 12

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Java Development Kit (JDK) 11 hasn’t yet reached general availability, but the OpenJDK community is already hard at work on JDK 12. That release, due in March 2019, will feature switch expressions.

According to InfoWorld, “Switch expressions, which will be in beta state in JDK 12, extends the switch statement so it can be used as either a statement or an expression. This would enable both forms to use either ‘traditional’ or ‘simplified’ scoping and control flow behavior. These changes would result in simplified ‘everyday’ coding and prepare the way for use of pattern matching in switch.”

View article

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories