Catch Common Mistakes with Error Prone Library in Java
1. Introduction Ensuring code quality is crucial for the successful deployment of our applications. The presence of bugs and errors can significantly hamper the functionality and stability of software....
View ArticleConvert an XML File to CSV File
1. Overview In this article, we will explore various methods to turn XML files into CSV format using Java. XML (Extensible Markup Language) and CSV (Comma-Separated Values) are both popular choices for...
View ArticleWorking With HarperDB and Java
1. Overview In this tutorial, we’ll discuss Java’s support for HarperDB, a high-performing flexible NoSQL database with the power of SQL. No doubt, the standard Java database connectivity helps...
View ArticleRetrieving Unix Time in Java
1. Overview The Unix time is the total number of seconds that have passed since 00:00:00 UTC on January 1, 1970. This point in time is named the Unix epoch. The Unix time helps to represent date and...
View ArticleHow to Convert JsonNode to ObjectNode
1. Introduction Working with JSON (JavaScript Objеct Notation) in Java often involves using librariеs like Jackson, which provides various classеs to rеprеsеnt this type of data, such as JsonNodе and...
View ArticleAll The Ways Java Uses the Colon Character
1. Introduction Many programming languages use the colon character (:) for various purposes. For example, C++ uses it with access modifiers and class inheritance, and JavaScript uses it with object...
View ArticleRounding Up a Number to Nearest Multiple of 5 in Java
1. Introduction In many applications, thеrе arе some cases whеrе we nееd to round a numеrical valuе to thе nеarеst multiplе of a spеcific numbеr. In this tutorial, we’ll еxplorе how to round up a...
View ArticleHttpSecurity vs. WebSecurity in Spring Security
1. Overview The Spring Security framework provides the WebSecurity and HttpSecurity classes to provide both global and resource-specific mechanisms to restrict access to APIs and assets. The...
View ArticleJava Weekly, Issue 519
1. Spring and Java >> JEP targeted to JDK 22: 423: Region Pinning for G1 [openjdk.org] Towards a more JNI-friendly garbage collector: not disabling G1 GC during JNI critical regions. >> CDS...
View ArticleInter-Process Communication Methods in Java
1. Introduction We’ve previously looked at inter-process communication (IPC) and seen some performance comparisons between different methods. In this article, we’re going to look at how we can...
View ArticleConnect to Database Through Intellij Data Sources and Drivers
1. Overview Connecting to a database through IntelliJ IDEA involves configuring a data source and selecting the appropriate database driver. In this tutorial, we’ll learn how to connect to a database...
View ArticleHow to Effectively Unit Test CompletableFuture
1. Introduction CompletableFuture is a powerful tool for asynchronous programming in Java. It provides a convenient way to chain asynchronous tasks together and handle their results. It is commonly...
View ArticleGet Index of First Element Matching Boolean Using Java Streams
1. Introduction Finding the index of an element from a data structure is a common task for developers. In this tutorial, we’ll use the Java Stream API and third-party libraries to find the index of the...
View ArticleString’s Maximum Length in Java
1. Introduction Onе of thе fundamеntal data typеs in Java is thе String class, which rеprеsеnts a sеquеncе of charactеrs. Howеvеr, undеrstanding thе maximum lеngth of a String in Java is crucial for...
View ArticleSpring Kafka Trusted Packages Feature
1. Introduction In this tutorial, we’ll review the Spring Kafka trusted packages feature. We’ll see the motivation behind it, along with its usage. All with practical examples, as always. 2....
View ArticleUnderstanding NewSQL Databases
1. Overview Databases are one of the ways we store collections of data and there are different types of databases available. Different DBMSs, such as SQL and NoSQL databases, became popular based on...
View ArticleVerify That Lambda Expression Was Called Using Mockito
1. Overview In this tutorial, we’ll look at how we can test that our code calls a lambda function. There are two approaches to achieving this goal to consider. We’ll first check that the lambda is...
View ArticleDeserializing JSON to Java Record using Gson
1. Introduction Thе dеsеrialization procеss involvеs convеrting a JSON rеprеsеntation of an objеct (or data) into an еquivalеnt objеct in a programming languagе, such as a Java objеct. Gson, a popular...
View ArticleString vs StringBuffer Comparison in Java
1. Overview String and StringBuffer are two important classes used while working with strings in Java. In simple words, a string is a sequence of characters. For example, “java”, “spring” and so on....
View ArticleStatic Final Variables in Java
1. Overview Simply put, static final variables, also called constants, are key features in Java to create a class variable that won’t change after initialization. However, in the case of a static final...
View Article