Java Weekly, Issue 528
1. Spring and Java >> Simplifying Java Development: Introducing Multi-File Program Launching [infoq.com] JEP 458 Unleashed: Empowering Seamless Development with Multi-File Source-Code Programs in...
View ArticleFind the Equilibrium Indexes of an Array in Java
1. Overview In this tutorial, we’ll first learn the definition of the equilibrium indexes of an array. Subsequently, we’ll write a method to identify and locate them. 2. Presentation of the Problem...
View ArticleConvert Date to Unix Timestamp in Java
1. Overview In computer science, Unix timestamp, also known as epoch time, is a standard way to represent a particular point in time. It denotes the number of seconds that have elapsed since January 1,...
View ArticleTranslating Space Characters in URLEncoder
1. Introduction When working with URLs in Java, it’s essential to ensure they are properly encoded to avoid errors and maintain accurate data transmission. URLs may contain special characters,...
View ArticleQuarkus and Virtual Threads
1. Overview In the ever-evolving landscape of Java development, the introduction of Java 21 brought forth a revolutionary feature – virtual threads. These lightweight threads, managed by the Java...
View ArticleCreating a Custom URL Connection
1. Introduction In Java, the URLConnection class provides basic functionality for connecting to resources specified by a URL. However, in certain scenarios, developers may need a custom implementation...
View ArticlePagination With JDBC
1. Introduction Large table reads can cause our application to run out of memory. They also add extra load to the database and require more bandwidth to execute. The recommended approach while reading...
View ArticleUnderstanding “Raw type. References to generic types should be parameterized”...
1. Overview Raw types are an advanced topic in Java. It required a good understanding of parametrized classes but might still be confusing. Luckily, IDEs can help us when we get things wrong. In...
View ArticleRun Maven From Java Code
1. Overview Maven is an integral tool for the majority of Java projects. It provides a convenient way to run and configure the build. However, in some cases, we need more control over the process....
View ArticleA Guide to the @SoftDelete Annotation in Hibernate
1. Overview While working with databases in our applications, we usually have to deal with deleting records that are no longer useful. However, due to business or regulatory requirements, such as data...
View ArticleIntroduction to OpenGrok
1. Overview OpenGrok is an open-source and powerful source code search and cross-reference engine. It allows us to explore, search, and navigate through the source code of various projects efficiently....
View ArticleMutable vs. Immutable Objects in Java
1. Introduction When working with objects in Java, understanding the difference between mutable and immutable objects is crucial. These concepts impact the behavior and design of your Java code. In...
View ArticleGet All Results at Once in a Spring Boot Paged Query Method
1. Overview In Spring Boot applications, we’re often tasked to present tabular data to clients in chunks of 20 or 50 rows at a time. Pagination is a common practice for returning a fraction of data...
View ArticleConvert Infix to Postfix Expressions in Java
1. Introduction In this tutorial, we’ll discuss the algorithm and code for converting the infix notation of a mathematical expression to a postfix notation. 2. Expressions in Java A programming...
View ArticleHow to Check if a Variable is Defined in Thymeleaf
1. Introduction In this tutorial, we’ll learn how to check if a variable is defined in Thymeleaf using three different methods. For this purpose, we’ll use Spring MVC and Thymeleaf to build a simple...
View ArticleMoves Zeros to the End of an Array in Java
1. Overview When we work with arrays in Java, one common task is rearranging arrays to optimize their structure. One such scenario involves moving zeros to the end of an array. In this tutorial, we’ll...
View ArticleFind the First Non-repeating Element of a List
1. Introduction In this tutorial, we’ll explore the problem of finding the first non-repeating element in a list. We’ll first understand the problem statement and then implement a few methods to...
View ArticleGuide to System.in.read()
1. Overview Java offers a variety of tools and functions to engage with user input. System.in.read() is one of the frequently used methods for reading input from the console. In this article, we’ll...
View ArticleCollect Stream of entrySet() to a LinkedHashMap
1. Overview In this tutorial, we’ll explore the different ways to collect a stream of Map.Entry objects into a LinkedHashMap. A LinkedHashMap is similar to HashMap but differs in the respect that it...
View ArticleCount Uppercase and Lowercase Letters in a String
1. Overview When working with String types in Java, it’s often necessary to analyze the composition of the characters within them. One common task is counting the number of uppercase and lowercase...
View Article