Quantcast
Channel: Baeldung
Browsing all 4535 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Detect the Last Iteration in for Loops in Java

1. Overview The for-each loop is an elegant and simple tool when we iterate over a List. Sometimes, there are scenarios where we need to perform specific actions or make decisions based on whether an...

View Article


Image may be NSFW.
Clik here to view.

Convert a String to a List of Characters in Java

1. Introduction Java offеrs sеvеral ways to manipulatе strings. In this tutorial, wе’ll еxplorе onе common rеquirеmеnt of convеrting a string into a list of charactеrs. 2. Using toCharArray() Thе...

View Article


Image may be NSFW.
Clik here to view.

Lazy Field Initialization with Lambdas

1. Introduction Frequently, when we work with resources that require the execution of expensive or slow methods, such as database queries or REST calls, we tend to use local caches or private fields....

View Article

Image may be NSFW.
Clik here to view.

Reactor WebFlux vs Virtual Threads

1. Overview In this tutorial, we’ll compare Java 19’s virtual threads with Project Reactor’s Webflux. We’ll begin by revisiting the fundamental workings of each approach, and subsequently, we’ll...

View Article

Image may be NSFW.
Clik here to view.

What Does It Mean to Hydrate an Object?

1. Introduction In this tutorial, we’ll talk about the term hydration in the context of programming and dive deep into what it means to hydrate a Java object.  2. Object Hydration 2.1. Lazy...

View Article


Image may be NSFW.
Clik here to view.

Convert Excel Files to PDF Using Java

1. Introduction In this article, we’ll explore how to convert Excel files to PDF in Java using the Apache POI and iText libraries. Apache POI handles Excel file parsing and data extraction, while iText...

View Article

Image may be NSFW.
Clik here to view.

Find Files by Extension in Specified Directory in Java

1. Introduction In this quick tutorial, we’ll see a few alternatives using core Java and external libraries to search for files in a directory (including sub-directories) that match a specific...

View Article

Image may be NSFW.
Clik here to view.

How to Get Last Record in Spring Data JPA

1. Overview In this short tutorial, we’ll explore different ways of getting the last record in Spring Data JPA. First, we’ll see how to do it using the Derived Queries Methods. Then, we’ll explore how...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 521

1. Spring and Java >> Stream API Evolution: A Closer Look at JEP 461’s Stream Gatherers [infoq.com] Meet Stream Gatherers: helping us to keep using Stream API for more complex intermediate...

View Article


Image may be NSFW.
Clik here to view.

Format LocalDate to ISO 8601 With T and Z

 1. Overview Handling date and time in a standardized format is crucial when working with applications that deal with different time zones or when exchanging data between systems. In this tutorial,...

View Article

Image may be NSFW.
Clik here to view.

Comparing One String With Multiple Values in One Expression in Java

1. Overview In this tutorial, we’ll discuss the various ways of finding a string among a group of strings using a single expression. Let’s assume there’s a fruit “Apple” and a group of fruits “Mango”,...

View Article

Image may be NSFW.
Clik here to view.

Read a File and Split it Into Multiple Files in Java

1. Overview In this tutorial, we’ll learn how to split a large file in Java. First, we’ll compare reading files in memory with reading files using streams. Later, we’ll learn to split files based on...

View Article

Image may be NSFW.
Clik here to view.

Calculate Months Between Two Dates in Java

1. Overview Calculating month intervals between dates is a common programming task. The Java standard library and third-party libraries provide classes and methods to calculate months between two...

View Article


Image may be NSFW.
Clik here to view.

Convert Byte Array to JSON and Vice Versa in Java

1. Introduction The manipulation and convеrsion of data between different formats are common tasks in most programming languages. One such scenario involves converting data between a byte array and...

View Article

Image may be NSFW.
Clik here to view.

Comparison of for Loops and Iterators

1. Introduction for loops and Iterators, both provide mechanisms to traverse through collections of elements. While both serve the purpose of iterating over collections, they differ in their syntax,...

View Article


Image may be NSFW.
Clik here to view.

How to Write Strings to OutputStream in Java

1. Overview We often work with OutputStream when we need to transfer data to external destinations such as files and networks. Data can either be in binary or string format. We use OutputStream, which...

View Article

Image may be NSFW.
Clik here to view.

Parse Java Source Code and Extract Methods

1. Introduction In this article, we’re going to investigate the JavaCompiler API. We’ll see what this API is, what we can do with it, and how to use it to extract the details of methods defined in our...

View Article


Image may be NSFW.
Clik here to view.

UTF-8 Validation in Java

1. Overview In data transmission, we often need to handle byte data. If the data is an encoded string instead of a binary, we often encode it in Unicode. Unicode Transformation Format-8 (UTF-8) is a...

View Article

Image may be NSFW.
Clik here to view.

Difference Between execute() and submit() in Executor Service

 1. Overview Multithreading and parallel processing are crucial concepts in modern application development. In Java, the Executor framework provides a way to manage and control the execution of...

View Article

Image may be NSFW.
Clik here to view.

Print a Double Value Without Scientific Notation in Java

1. Introduction In our daily tasks, we may often come across challenges to format double values. One such challenge could be printing a double value, avoiding scientific notation. Even though this...

View Article
Browsing all 4535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>