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

Image may be NSFW.
Clik here to view.

How to Use if/else Logic in Java 8 Streams

1. Overview In this tutorial, we’re going to demonstrate how to implement if/else logic with Java 8 Streams. As part of the tutorial, we’ll create a simple algorithm to identify odd and even numbers....

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 250

Here we go… 1. Spring and Java >> How Java Maps Protect Themselves From DOS Attacks [javaspecialists.eu] A deep dive into the evolution of the hashCode method in the String class. A fascinating...

View Article


Image may be NSFW.
Clik here to view.

Use the Latest Version of a Dependency in Maven

1. Overview Upgrading Maven dependencies manually has always been a tedious work, especially in projects with a lot of libraries releasing frequently. In this tutorial, we’ll learn how to exploit the...

View Article

Image may be NSFW.
Clik here to view.

Guide to DateTimeFormatter

1. Overview In this tutorial, we’ll review the Java 8 DateTimeFormatter class and its formatting patterns. We’re also going to discuss possible use cases for this class. We can use DateTimeFormatter...

View Article

Image may be NSFW.
Clik here to view.

Difference Between @NotNull, @NotEmpty, and @NotBlank Constraints in Bean...

1. Overview Bean Validation is a standard validation specification that allows us to easily validate domain objects by using a set of constraints declared in the form of annotations. While overall,...

View Article


Image may be NSFW.
Clik here to view.

Guide to EnumSet

1. Introduction In this tutorial, we’ll explore the EnumSet collection from the java.util package and discuss its peculiarities. We’ll first show the main features of the collection and after that,...

View Article

Image may be NSFW.
Clik here to view.

Write an org.w3.dom.Document to a File

1. Overview An important part of XML handling is creating XML files that can be consumed by others. When handling XML in Java, we’ll often have an instance of org.w3c.dom.Document that we need to...

View Article

Image may be NSFW.
Clik here to view.

Setting the Java Version in Maven

1. Overview In this quick tutorial, we’ll show how to set the Java version in Maven. Before moving ahead, we can check the default JDK version of Maven. Running the mvn -v command will show the Java...

View Article


Image may be NSFW.
Clik here to view.

Converting Between Byte Arrays and Hexadecimal Strings in Java

1. Overview In this tutorial, we’ll take a look at different ways to convert a byte array to a hexadecimal String, and vice versa. We’ll also understand the conversion mechanism and write our...

View Article


Image may be NSFW.
Clik here to view.

Java 8 Streams: Find Items From One List Based On Values From Another List

1. Overview In this quick tutorial, we’ll learn how to find items from one list based on values from another list using Java 8 Streams. 2. Using Java 8 Streams Let’s start with two entity classes –...

View Article

Image may be NSFW.
Clik here to view.

Guide to Ebean ORM

1. Introduction Ebean is an object-relational mapping tool written in Java. It supports the standard JPA annotations for declaring entities. However, it provides a much simpler API for persisting. In...

View Article

Image may be NSFW.
Clik here to view.

Multi-Module Project with Maven

1. Overview In this tutorial, we’ll show how to build a multi-module project with Maven. First, we’ll discuss what’s a multi-module project and have a look at the benefits of following this approach....

View Article

Image may be NSFW.
Clik here to view.

Exploring the Jersey Test Framework

1. Overview In this tutorial, we’re going to take a look at the Jersey Test Framework and see how we can use it to quickly write integration tests. As we’ve already seen in previous articles, Jersey...

View Article


Image may be NSFW.
Clik here to view.

An Introduction to Spring Data Redis Reactive

1. Introduction In this tutorial, we’re going to learn how to configure and implement Redis operations using Spring Data’s ReactiveRedisTemplate.  We’ll go over the basic usages of the...

View Article

Image may be NSFW.
Clik here to view.

JAVA_HOME should point to a JDK not a JRE

1. Introduction In this tutorial, we’re going to talk about an exception that Maven throws when misconfigured: JAVA_HOME should point to a JDK, not a JRE. Maven is a powerful tool for building code....

View Article


Image may be NSFW.
Clik here to view.

Using JUnit 5 with Gradle

1. Overview In this tutorial, we’re going to run tests on the new JUnit 5 platform with the Gradle build tool.  We’ll configure a project that supports both the old and the new version. Feel free to...

View Article

Image may be NSFW.
Clik here to view.

The Modulo Operator in Java

1. Overview In this short tutorial, we’re going to show what the modulo operator is, and how we can use it with Java for some common use cases. 2. The Modulo Operator Let’s start with the shortcomings...

View Article


Image may be NSFW.
Clik here to view.

Convert XML to JSON Using Jackson

1. Overview In this tutorial, we’ll see how to convert an XML message to JSON using Jackson. For readers new to Jackson, consider getting familiar with the basics first. 2. An Introduction to Jackson...

View Article

Image may be NSFW.
Clik here to view.

Concrete Class in Java

1. Introduction In this quick guide, we’ll discuss the term “concrete class” in Java. First, we’ll define the term. Then, we’ll see how it’s different from interfaces and abstract classes. 2. What is...

View Article

Image may be NSFW.
Clik here to view.

An Introduction to Synchronized Java Collections

1. Overview The collections framework is a key component of Java. It provides an extensive number of interfaces and implementations, which allows us to create and manipulate different types of...

View Article
Browsing all 4535 articles
Browse latest View live