BASIC / NOTES</>↗Basic31 May 2025
In Java 14, along with the -XX:+ShowCodeDetailsInExceptionMessages feature, Helpful NullPointerExceptions were introduced. This feature provides detailed and precise messages when a NullPointerException (NPE) occurs. It is available starting from Java 14 as a preview feature and was enabled by default (no longer requiring the JVM flag) starting with Java 16. This behavior continues in Java […]
BASIC / NOTES</>↗Basic30 May 2025
In Java 17, you can use the record feature to create immutable data models. Records are a new type of class in Java designed specifically to hold immutable data. Using records simplifies creating classes that are essentially data carriers. Here’s a step-by-step guide on how to create and use records in Java 17: What is […]
BASIC / NOTES</>↗Basic30 May 2025
Java 17 introduced sealed classes as part of the enhancements to the type system. Sealed classes allow developers to explicitly control which classes can extend or implement a class or interface, thereby achieving better type safety and making it easier to design domain-specific hierarchies. Here’s a guide on how to use sealed classes effectively: What […]
BASIC / NOTES</>↗Basic29 May 2025
Pattern matching with the instanceof operator was introduced in Java 16 (as a preview feature) and became a standard feature in Java 17. It simplifies the process of type casting when checking an object’s type, making the code shorter and more readable. Here’s how you can use pattern matching with instanceof in Java 17: Syntax […]
BASIC / NOTES</>↗Basic29 May 2025
In Java 17, switch expressions provide a more concise and streamlined way to handle conditional logic. This feature was introduced in Java 12 as a preview and made a standard feature in Java 14. Java 17, being a Long-Term Support version, includes this feature as well. Let me guide you through how to use them. […]
JAVA 10 / NOTES</>↗Java 1028 May 2025
Java 10 introduced Thread-Local Handshakes as a powerful feature in the JVM, designed to improve the performance and responsiveness of applications, especially in scenarios involving thread-based operations and garbage collection. Here’s what you need to know about Thread-Local Handshakes and how to leverage them for performance tuning: 1. What are Thread-Local Handshakes? Thread-Local Handshakes allow […]