Java 16 – Pattern matching for instanceof

We all have used instanceof check with a subsequent cast to the desired type and in this process, we are doing two operations: validating whether the object we have is of the desired type using instanceof when the validation is true then we cast the object to the desired type and proceed with the operations. … Read more

Java 16 – Records and Constructor

In my previous post, I introduced you to the new construct called Records which was introduced in Java 16. In this post, I will go a bit deeper into how you can override the default constructor of a record which is different from the no-arg default constructor of a class. Default constructor in a record … Read more

Java 16 – Records

We all, Java programmers, have complained whenever we were forced to create a class or use maps just to hold some data whilst other newer languages provided some out-of-the-box data structure for the same. Our problem has been addressed by introducing “Records” as part of the JEP 395 in Java 16. This construct is introduced … Read more