Did you know that JDK 19 added some new factory methods to “map” collections based on a hash table? These new methods weren’t much publicized, so I guess many developers don’t know their existence. This short article provides an overview of this little new feature.
What would you answer if I asked you how many ways there are to build/format strings in Java? Maybe you could answer there are a few. No, it’s wrong! There are really many ways to build and format strings, at least up to Java 21. In this article, I will provide a good overview of…
This short article provides an overview of the various possibilities to obtain the “identity string” for any Java object. This little feature is sometimes very helpful for debugging/logging purposes.
Java 21 was released a few days ago, and today, I had some free time to try out the new String Templates feature described in the JEP-430. In this article, I provide a simple demonstrative example of a custom string template processor so that you can better understand the usefulness of this new feature.
Do you need a quick overview of all Java versions? Please check out the friendly and helpful Java Versions Cheat Sheet! It is developed and actively maintained by me.
Inheritance and correlated polymorphism are among the most important concepts in OOP languages like Java, Kotlin, C#, and others. In this article, I will explain two typical cases of wrong inheritance usage that anyone should not imitate.
When developing Spring Boot applications, I often need to check if property values are correctly received from configuration files, environment variables, or other sources. There are various ways to perform this task. This article will present my solution for dumping the Spring Environment using a simple application listener.
On my blog, I generally write articles on Java programming topics that already exist. This time, however, I want to write about a new hypothetical mapStream method that currently doesn’t exist in the Java Stream API but could be interesting to add.
In this article, I will discuss iterating two collections simultaneously. This is not a very recurring topic in Java, but sometimes it may be necessary. The main goal of this article, in particular, is to show how to create some good code designs for greater code reuse.
I worked several times on Spring Boot applications that use Lombok, a famous code-generation tool based on annotation processing. In this article, I will discuss using Spring’s @Value annotation in a “component” class annotated with Lombok.