When do you use a module-info.java file, and what goes into it?Imagine you are working on a new unit testing framework for Java classes and start with the following folder hierarchy:src └───com └───acme └───test └───Test.javaThere’s a single base Java...
Friday, June 30, 2023
Wednesday, June 28, 2023
Handling time zones in distributed systems, Part 1
Learn how to use Java APIs to handle time zone conversions in your applications.Handling dates and times in applications is a common and challenging problem requiring a particular design and implementation to ensure a correct solution. The problem is compounded because applications are required to handle customers across...
Monday, June 26, 2023
The Untold Story of JVM Internals: Unveiling the Inner Workings of Java's Engine
IntroductionWelcome to an in-depth exploration of the Java Virtual Machine (JVM), the powerhouse behind Java's exceptional performance and platform independence. In this comprehensive article, we will delve into the intricacies of JVM internals, uncovering its hidden mechanisms and shedding light on its remarkable functionality. Prepare to embark on...
Friday, June 23, 2023
Method handles: A better way to do Java reflection
Java 18 introduced method handles, which offer a better way to do reflective programming.What is reflection? Why does it matter? The previous articles in this series (see “Reflection for the modern Java programmer” and “The performance implications of Java reflection”) explored the topic and discussed the implementation of...
Wednesday, June 21, 2023
Quiz yourself: Locking mechanisms and Java’s postincrement ++ operator
Let’s see if this quiz code will work consistently.Imagine that your colleagues want to perform calculations in parallel. In pursuit of thread safety, they implemented the following locking mechanism:var lock = new ReentrantLock();var s = IntStream.of(1, 2, 3);var i = s.parallel().map( v -> { lock.tryLock(); var...
Monday, June 19, 2023
Oracle Java: The Key to Developing Next-Generation Software
IntroductionIn today's rapidly advancing technological landscape, the demand for cutting-edge software development has never been higher. To meet these evolving needs, developers require a powerful and versatile programming language. Oracle Java emerges as the ultimate solution, empowering developers to create next-generation software applications that redefine the boundaries of...
Friday, June 16, 2023
Announcing Graal Cloud Native
We're pleased to announce the general availability of Graal Cloud Native (GCN) v3.8.5.GCN is a curated set of open source Micronaut® framework modules that simplify multicloud application development and are designed from the ground up to be compiled ahead-of-time with GraalVM Native Image. GCN enables you to easily...
Wednesday, June 14, 2023
Quiz yourself: Delegation using super(...) and this(...) during constructor execution
There are rules for explicit constructor invocations. Do you know them?Given the following two classesclass Building { Building nextBuilding; Building() {} Building(Building nb) { nextBuilding = nb; }}class Hotel extends Building { final Building nb = new Building();}Which constructor can be added to the Hotel class without...