How to Use a Custom Font in Java
1. Introduction Whеn wе dеvеlop our Java applications, wе may nееd to dеsign them with custom fonts to makе things appеar morе clear in GUI. Fortunately, Java has a wide range of fonts which comе by...
View ArticleJava Weekly, Issue 518
1. Spring and Java >> JEP targeted to JDK 22: JEP 456: Unnamed Variables & Patterns [openjdk.org] The second preview of unnamed variables and patterns in Java 22: useful when we don’t need...
View ArticleConvert Positive Integer to Negative and Vice Versa in Java
1. Overview In Java programming, understanding how to manipulate integers is fundamental to writing robust and efficient code. One common operation is negating an integer. In this tutorial, we’ll...
View ArticleHow to Convert Byte Array to Char Array
1. Introduction Convеrting bytеs to a charactеr array in Java involvеs transforming a sеquеncе of bytеs into its corrеsponding array of charactеrs. To bе spеcific, bytеs rеprеsеnt raw data, whеrеas...
View ArticleCheck if a double Is an Integer in Java
1. Overview Dealing with numerical data often requires precision handling. One common scenario arises when we need to check whether a double is, in fact, a mathematical integer. In this tutorial, we’ll...
View ArticleResolving Gson’s “Multiple JSON Fields” Exception
1. Overview Google Gson is a useful and flexible library for JSON data binding in Java. In most cases, Gson can perform data binding to an existing class with no modification. However, certain class...
View ArticleCatch 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 Article