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

Image may be NSFW.
Clik here to view.

Java Weekly, Issue 516

1. Spring and Java >> Table partitioning with Spring and Hibernate [vladmihalcea.com] Splitting a large table into multiple smaller partition tables using Spring and Hibernate — allowing a more...

View Article


Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

Get 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 Article

Image may be NSFW.
Clik here to view.

String’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

Image may be NSFW.
Clik here to view.

Spring 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 Article


Image may be NSFW.
Clik here to view.

Understanding 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 Article

Image may be NSFW.
Clik here to view.

Verify 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 Article

Image may be NSFW.
Clik here to view.

Deserializing 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 Article


Image may be NSFW.
Clik here to view.

String 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 Article


Image may be NSFW.
Clik here to view.

Static 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

Image may be NSFW.
Clik here to view.

Differences Between Entities and DTOs

1. Overview In the realm of software development, there is a clear distinction between entities and DTOs (Data Transfer Objects). Understanding their precise roles and differences can help us build...

View Article

Image may be NSFW.
Clik here to view.

Handling NullPointerException in findFirst() When the First Element Is Null

1. Overview In this short tutorial, we’ll explore different ways of avoiding NullPointerException when working with the findFirst() method. First, we’ll explain what causes the method to fail with...

View Article

Image may be NSFW.
Clik here to view.

Skip Bytes in InputStream in Java

1. Introduction In Java programming, InputStrеam is a fundamеntal class for rеading bytеs from a sourcе. Howеvеr, thеrе arе scеnarios whеrе it bеcomеs nеcеssary to skip a cеrtain numbеr of bytеs within...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 520

1. Spring and Java >> JEP targeted to JDK 22: 464: Scoped Values (Second Preview) [openjdk.org] Another preview of Scoped Values: a safe and efficient way of sharing immutable data within and...

View Article

Image may be NSFW.
Clik here to view.

A Guide to Timefold Solver for Employee Scheduling

1. Overview 1.1. What Is Timefold Solver? Timefold Solver is a pure Java planning solver AI. Timefold optimizes planning problems, such as the vehicle routing problem (VRP), maintenance scheduling, job...

View Article


Image may be NSFW.
Clik here to view.

Recursively Sum the Integers in an Array

1. Overview When we work with numbers, summing all integers in an array is a common operation. Also, recursion often lends itself to elegant solutions. In this tutorial, we’ll explore how to sum...

View Article

Image may be NSFW.
Clik here to view.

BigDecimal.ZERO vs. new BigDecimal(0)

1. Overview When we work with BigDecimal, representing the numerical value zero using BigDecimal is a common task. However, we’re often faced with a choice between two similar approaches: using...

View Article


Image may be NSFW.
Clik here to view.

Convert an OutputStream to a Byte Array in Java

1. Introduction Dealing with strеams is a common task, еspеcially when working with input and output opеrations. Occasionally, the need arises to convеrt an OutputStrеam into a bytе array. This can be...

View Article

Image may be NSFW.
Clik here to view.

Callbacks in ListenableFuture and CompletableFuture

1. Overview ListenableFuture and CompletableFuture are built on top of Java’s Future interface. The former is part of Google’s Guava library, whereas the latter is part of Java 8. As we know, the...

View Article

Image may be NSFW.
Clik here to view.

Creating a Kafka Listener Using the Consumer API

1. Overview In this tutorial, we’ll learn how to create a Kafka listener and consume messages from a topic using Kafka’s Consumer API. After that, we’ll test our implementation using the Producer API...

View Article
Browsing all 4535 articles
Browse latest View live


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