Records in Java look very promising to me and a great addition to the language. The ceremony of creating pure data holder classes will be well know to any Java developer. Sometimes we just create a class to transport some data from A to B. Most of the times we don’t even care about object… Continue reading Records in Java (JEP 359, preview)
Category: Java 14
Switch Expressions in Java (JEP 361)
With Java 14 we will get a new feature that simplifies the switch statement. It will provide a new and clearer way to write switch statements and in addition allows us to use switch as an expression yielding a value. New Syntax Forget about break! No fall through anymore – simple and concise. Today you… Continue reading Switch Expressions in Java (JEP 361)
Pattern Matching for instanceof (JEP 305)
Finally with Java 14 we get a (preview) feature I had on my wishlist for a long time. It eliminates the need to first test an object via instanceof operator and then (and I asusme it is the 90% case) cast it to exact that class in order to do something with it. Here is… Continue reading Pattern Matching for instanceof (JEP 305)