Download File from S3 Given a URL
1. Introduction In today’s software landscape, interacting with cloud storage services such as Amazon Simple Storage Service (S3) has become a fundamental aspect of many applications. One common...
View ArticleFind the Length of the Longest Symmetric Substring
1. Introduction Determining the length of the longest symmetric substring poses a common challenge in string manipulation tasks. In this tutorial, we’ll discuss two Java approaches for efficiently...
View ArticlePrint the Default Value When Overriding toString() Method
1. Introduction We can use the toString() method in Java to return a string representation of an object. Often, it’s overridden to provide a meaningful description of the object’s state. However,...
View ArticleFinding the Redirected URL of a URL in Java
1. Introduction Understanding how URLs are redirected is crucial in web development and network programming tasks, such as handling HTTP redirects, validating URL redirects, or extracting final...
View ArticleDifferent Ways to Use Limit and Skip in MongoRepository
1. Introduction When working with MongoDB in Spring Data, the MongoRepository interface provides a simple way to interact with MongoDB collections using built-in methods. In this quick tutorial, we’ll...
View ArticleFind the Date of Easter Sunday for the Given Year
1. Overview In this tutorial, we’ll understand why the Easter date is complex to compute. Then, we’ll implement three algorithms to calculate it in Java: the Gauss, Butcher-Meeus, and Conway...
View ArticleJava Weekly, Issue 538
1. Spring and Java >> JEP 473: Stream Gatherers (Second Preview) [openjdk.org] The second preview of Stream Gatherers in Java 23 — going beyond pre-defined intermediate operations in Stream API...
View ArticleIntroduction to Simple Java Mail
1. Introduction Simple Java Mail is a popular open-source library that simplifies sending emails in Java applications. It provides a user-friendly API compared to the standard JavaMail API, allowing us...
View Article“Not a Managed Type” Exception in Spring Data JPA
1. Overview When using Spring Data JPA we may encounter issues during the bootstrap time. Some of the beans may not be created, causing the application not to start. While the actual stack trace may...
View ArticleCompress and Create a Byte Array Using GZip
1. Overview The GZIP format is a file format used in data compression. The GZipInputStream and GZipOutputStream classes of the Java language implement this file format. In this tutorial, we’ll learn...
View ArticleImplement Update-Or-Insert in Spring Data JPA
1. Introduction In application development, the need to perform an update-or-insert operation, also known as “upsert”, is quite common. This operation involves putting a new record into a database...
View ArticleDifference Between Casting to String and String.valueOf()
1. Overview Manipulating Strings is a fundamental task when we work with Java. We often need to convert other data types into Strings. Two common approaches for accomplishing this are casting to String...
View ArticleImplement the Builder Pattern in Java 8
1. Introduction In our journey through software development, we often encounter scenarios where creating objects with numerous properties becomes intimidating. Cluttering our constructors is making our...
View ArticleConvert String to OffsetDateTime
1. Introduction Dealing with date and time values is a common task in software development, especially when building applications that involve scheduling, logging, or any time-sensitive operations. In...
View ArticlePersistenceUnit vs. PersistenceContext
1. Overview Persistence context and persistence unit are two important concepts in JPA that we use to manage the lifecycle of entities in an application. In this tutorial, we’ll take a look at a brief...
View ArticleCalculating Moving Averages in Java
1. Overview Moving averages are a fundamental tool in analyzing trends and patterns in data and are widely used in finance, economics, and engineering. They help smooth out short-term fluctuations and...
View ArticleJava Weekly, Issue 539
1. Spring and Java >> A preview of Jakarta Data 1.0 (Part II) [in.relation.to] Another new persistence specification for Java: exploring some dynamic features of Jakarta Data like static...
View ArticleFinding the nth Last Occurrence of char in String
1. Introduction In various text processing tasks, it’s common to encounter scenarios where we need to find the nth last occurrence of a specific character within a given string. Moreover, this...
View ArticleBigDecimal equals() vs. compareTo()
1. Overview Correctly handling numbers is crucial to any programming language. However, some applications rely more on the exact values and require a better representation of decimal numbers. For...
View ArticleUnit Test for hashCode() in Java
1. Introduction In Java, we can use the hashCode() method to generate a hash code value for an object. This value is typically used for various purposes, such as storing objects in collections like...
View Article