The Java compiler is able to pre-calculate certain values for us at compile time. This allows us to use some variables with expressions that must be constant, and leads to some runtime efficiencies.
Search Results for: constant
Where Does Java’s String Constant Pool Live, the Heap or the Stack?
Learn about the storage area for String constant pool.
An Introduction to the Constant Pool in the JVM
Learn about the constant pool in JVM.
Constants in Java: Patterns and Anti-Patterns
Learn about using constants in Java with a focus on common patterns and anti-patterns
Fixing “constant string too long” Build Error
Learn to fix the “constant string too long” build error in Java.
OpenAPI Custom Generator
Learn the steps required to create a custom generator for the OpenAPI generator tool.
Mapping Enum to String Using MapStruct
A quick tutorial on using MapStruct to convert enums to strings.
Finding The Index of the Smallest Element in an Array
Learn how to find the index of the smallest element in an array.
Java Weekly, Issue 540
Avoiding n+1 queries, Spring AI, JMS, Graal dev kit, and GitHub actions on Raspberry PI!
Intro to Apache Commons Configuration Project
Apache Commons Configuration can be used to allow us to specify configuration parameters to be loaded at runtime by our application. We look at a few use cases and types of configuration files.
Unit Test for hashCode() in Java
Explore the importance of unit testing for the hashCode() method in Java.
Calculating Moving Averages in Java
Let’s explore various methods and techniques for calculating moving averages, ranging from traditional approaches to libraries and Stream API’s.
Mapping Enum With MapStruct
Learn to map between enum types and other data types like strings or integers using MapStruct’s @ValueMapping
Java InputStream vs. InputStreamReader
Learn how an InputStreamReader builds on an InputStream to assist when working with streams of characters.
When to Use Setter Methods or Constructors for Setting a Variable’s Value in Java
Learn when to use setter methods or constructors for setting the value of a variable in Java.
Dynamically Register Spring Beans Based on Properties
Learn how to dynamically register beans based on custom properties.
Dynamically Managing Kafka Listeners in Spring Boot
Learn how to manage Kafka Listeners dynamically in Spring Boot.
Find the Largest Number Possible After Removing k Digits of a Number
A quick and practical guide to finding the largest number possible after removing k digits of a number.
Introduction to Redpanda
Discover Redpanda, a powerful event streaming platform and one of Kafka’s competitors.
Check if a Number Is a Happy Number in Java
Learn how to check if a number is a happy or sad number in Java.