Articles for December, 2018

Next Steps to Pattern Matching in Java with Java 12 and Switch Expressions aka JEP 325

Sunday, December 30th, 2018

It is interesting to see how the Java language evolves over time. One thing that I have always missed is pattern matching in a way similar to languages like Scala.

Now there are different JDK Enhancement Proposals (JEP) aiming at bringing us a little bit closer to pattern matching, especially JEP 325 aka Switch Expressions that are included in the current Java 12 preview or JEP 305 aka Pattern Matching for instanceof.

In the following article, I’d like to demonstrate how to use switch expressions in our applications.