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

Image may be NSFW.
Clik here to view.

Rotating a Java String By n Characters

1. Overview In our daily Java programming, strings are often the fundamental objects we must handle. Sometimes, we need to rotate a given string by n characters. Rotating a string involves shifting its...

View Article


Image may be NSFW.
Clik here to view.

Get Client Information From HTTP Request in Java

1. Overview Web applications mainly work on the request-response model, and this model describes data exchange between a client and a web server using HTTP protocol. At the server end, which accepts or...

View Article


Image may be NSFW.
Clik here to view.

Sorting One List Based on Another List in Java

1. Overview Sorting a list based on the order of another list is a common task in Java, and various approaches exist to achieve this. In this tutorial, we’ll see different ways of sorting a list based...

View Article

Image may be NSFW.
Clik here to view.

Check If a Java StringBuilder Object Contains a Character

1. Introduction Thе StringBuildеr class in Java provides a flеxiblе and еfficiеnt way to manipulatе strings. In some cases, we nееd to chеck whеthеr a StringBuildеr objеct contains a specific...

View Article

Image may be NSFW.
Clik here to view.

@Query Definitions With SpEL Support in Spring Data JPA

1. Overview SpEL stands for Spring Expression Language and is a powerful tool that can significantly enhance our interaction with Spring and provide an additional abstraction over configuration,...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 522

1. Spring and Java >> Hibernate StatelessSession Upsert [vladmihalcea.com] A portable way of performing an upsert using Hibernate StatelessSession’s Upsert method. Interesting. >> This Year...

View Article

Image may be NSFW.
Clik here to view.

Determine the Class of a Generic Type in Java

1. Overview Generics, which was released in Java 5, allowed developers to create classes, interfaces, and methods with typed parameters, enabling the writing of type-safe code. Extracting this type of...

View Article

Image may be NSFW.
Clik here to view.

Java System.currentTimeMillis() Vs. System.nanoTime()

1. Introduction Two commonly used mеthods for timе mеasurеmеnt in Java arе Systеm.currеntTimеMillis() and Systеm.nanoTimе(). Whilе both mеthods providе a way to mеasurе timе, thеy sеrvе diffеrеnt...

View Article


Image may be NSFW.
Clik here to view.

Dead Letter Queue for Kafka With Spring

1. Introduction In this tutorial, we’ll learn how to configure a Dead Letter Queue mechanism for Apache Kafka using Spring. 2. Dead Letter Queues A Dead Letter Queue (DLQ) is used to store messages...

View Article


Image may be NSFW.
Clik here to view.

Using XML in @RequestBody in Spring REST

1. Overview While JSON is a de-facto standard for RESTful services, in some cases, we might want to work with XML. We can fall back to XML for different reasons: legacy applications, using a more...

View Article

Image may be NSFW.
Clik here to view.

Return Map instead of List in Spring Data JPA

1. Overview Spring JPA provides a very flexible and convenient API for interaction with databases. However, sometimes, we need to customize it or add more functionality to the returned collections....

View Article

Image may be NSFW.
Clik here to view.

Compress and Uncompress Byte Array Using Deflater/Inflater

1. Overview Data compression is a crucial aspect of software development that enables efficient storage and transmission of information. In Java, the Deflater and Inflater classes from the...

View Article

Image may be NSFW.
Clik here to view.

Difference Between 1L and (long) 1

1. Overview In this tutorial, we’ll explore the differences between the literal representation of a long type and the conversion of an int value to a long value using the cast operator. 2. Literal...

View Article


Image may be NSFW.
Clik here to view.

When to Use the getReferenceById() and findById() Methods in Spring Data JPA

1. Overview JpaRepository provides us with basic methods for CRUD operations. However, some of them are not so straightforward, and sometimes, it’s hard to identify which method would be the best for a...

View Article

Image may be NSFW.
Clik here to view.

Bind Case Insensitive @Value to Enum in Spring Boot

1. Overview Spring provides us with autoconfiguration features that we can use to bind components, configure beans, and set values from a property source. @Value annotation is useful when we don’t want...

View Article


Image may be NSFW.
Clik here to view.

Unreachable Statements in Java

1. Overview In this tutorial, we’ll talk about the Java specification that states that the compiler should raise an error if any statement is unreachable. An unreachable statement is a code that can...

View Article

Image may be NSFW.
Clik here to view.

Create a Mutable String in Java

1. Introduction In this tutorial, we’ll discuss a few ways to create a mutable String in Java. 2. Immutability of Strings Unlike other programming languages like C or C++, Strings are immutable in...

View Article


Image may be NSFW.
Clik here to view.

Convert a Hex String to an Integer in Java

1. Introduction Converting a hexadecimal (Hex) string into an integer is a frequent task during programming, particularly when handling data types that use hexadecimal notations. In this tutorial,...

View Article

Image may be NSFW.
Clik here to view.

Splitting Streams in Kafka

1. Introduction In this tutorial, we’ll explore how to dynamically route messages in Kafka Streams. Dynamic routing is particularly useful when the destination topic for a message depends on its...

View Article

Image may be NSFW.
Clik here to view.

Comparing the Values of Two Generic Numbers in Java

1. Introduction Java’s versatility is evident in its ability to handle generic Number objects. In this tutorial, we’ll delve into the nuances of comparing these objects, offering detailed insights and...

View Article
Browsing all 4535 articles
Browse latest View live


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