Tag: pattern matching for instanceof

  • How to use Pattern Matching for instanceof operator in Java?

    Let’s say you have a generic method which accepts any object as a parameter. Based on the type of the object , the method performs custom operations. Traditionally to implement this you need to do the following steps: Check the passed parameter using instanceof operator for the specific type If it matches , cast the…

  • 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…