Tag: records

  • Java 21 – Unnamed Patterns and Variables

    Java 21 – Unnamed Patterns and Variables

    Let’s say you have declared a variable in your Java program. But you are not going to use it for some reason. May be you declared an exception variable in a catch block but not going to use the variable at all: Or in a for loop statement: Or in Pattern Matching of Records (introduced…

  • Java 15 features every Java developer should know

    Java 15 just arrived. There were in total 14 features introduced in this release. But not every feature needs to be understood from a developer perspective. Only 4 of the 14 features are must to know features for java developers to utilize in their java applications. Here are those four: Sealed classes Text blocks Records…

  • How to use Records in Java

    Java 14 came up with a new feature called Records to reduce boiler plate code. One criticism against Java is that it takes too much code to achieve something compared to other languages like Python. The recent features in Java have been primarily targeted to reduce its verbosity. Records are one such feature. Usually when…