Spring Boot 3.x New Features
Spring Boot 3.x brings a wave of exciting new features and improvements designed to empower developers and enhance the performance and functionality of Java applications. This major release marks a...
View ArticleConverting Between ZonedDateTime and Date in Java
In Java, managing date and time can involve converting between different types, such as ZonedDateTime and Date. This is particularly useful when dealing with legacy code or APIs that use the older Date...
View ArticleLeveraging the Power of Kafka with Quarkus: A Professional Guide
1. Understanding Apache Kafka Integration with Quarkus Apache Kafka – A Distributed Event Streaming Platform Apache Kafka is a widely-used open-source distributed event streaming platform that enables...
View ArticleUsing Java 8 Optionals: Perform Action Only If All Are Present
Java’s Optional class provides a container object which may or may not contain a non-null value. This is useful for avoiding null checks and preventing NullPointerException. Sometimes, we may need to...
View ArticleCheck if a Number Is Power of 2 in Java
In this article, we will explore different approaches to check if a given number is a power of 2 in Java. We will cover the following methods: Loop Division Using Bitwise & Operations Counting Set...
View ArticleCheck if Two Strings Are Permutations of Each Other in Java
In this article, we will explore different approaches to check if two strings are permutations of each other in Java. 1. What Is a String Permutation? A string permutation is a rearrangement of the...
View ArticleReactive Programming with Java Project Loom
The article argues that reactive programming and Project Loom are complementary tools for building concurrent applications in Java, rather than competing approaches. It highlights the strengths of...
View ArticleConvert Short to Byte Array
1. Introduction Converting a short value to a byte array is a common task when dealing with binary data. In this example, I will demonstrate short byte array conversion in the following ways: Using...
View ArticleJackson JsonNode to Java Collections
Java applications frequently interact with data in JSON (JavaScript Object Notation) format. Jackson Java Library provides tools for working with JSON data. One key aspect is converting raw JSON data...
View ArticleUsing Enum in Spring Data JPA Queries
When constructing our persistence layer using Spring Data JPA, we frequently deal with entities that contain enum fields. These enum fields represent a predefined set of constants, such as order...
View ArticleConversion of InputStream to Stream in Java
In this article, we will explore different approaches for InputStream to Stream conversion in Java. 1. Introduction In Java, InputStream is a fundamental class in the java.io package that represents an...
View ArticleGet the First and the Last Elements From an Array in Java
In this article, we will explore different approaches to getting the first and last elements from an array in Java. 1. What are arrays in Java? In Java, arrays are a fundamental data structure used to...
View ArticleSupply Enum Value to an Annotation From a Constant in Java
In this tutorial, we will delve into how Java allows us to use a constant to supply an enum value to an annotation, exploring various techniques and best practices. 1. What is Enum in Java? Enums,...
View ArticleConverting a Map to a Spring MultiValueMap
In Spring, a MultiValueMap is a structure for storing multiple values for a single key. This can be useful in scenarios such as HTTP parameters or headers where we might have multiple values for a...
View ArticleList Private Keys From a JKS Keystore
A Keystore is a repository that contains security certificates and their corresponding private keys. Listing private keys from a keystore is an essential task for managing and verifying the contents of...
View ArticleJava Input Handling: Clearing the Scanner Buffer
When working with the Scanner class in Java for input, especially from the console, it is common to encounter issues related to leftover newline characters in the buffer. These residual characters can...
View ArticleRemove Byte Order Mark Characters from File
The Byte Order Mark (BOM) signifies a file’s encoding but can lead to problems if not handled properly, particularly when dealing with text data. Additionally, it is not unusual to encounter files that...
View ArticleJUnit vs Mockito: How They Differ
When it comes to developing Java applications, unit testing is an essential practice. Two widely used tools in this domain are JUnit and Mockito. While they serve complementary purposes, understanding...
View ArticleJava for Machine Learning with TensorFlow or PyTorch
While Python reigns supreme in the world of machine learning (ML), Java developers aren’t entirely left out. While TensorFlow and PyTorch primarily focus on Python for their core functionalities, Java...
View ArticleUnderstanding Maven Dependency Graph or Tree
Working on large Maven projects can be daunting, especially when it comes to managing dependencies between modules and libraries and resolving conflicts among them. Let us delve into understanding...
View Article