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

Image may be NSFW.
Clik here to view.

Reading a .gz File Line by Line Using GZIPInputStream

1. Overview We may wish to work with compressed files in Java. A common format is .gz, as generated by the GZIP utility. Java has a built-in library for reading .gz files, which are commonly used for...

View Article


Image may be NSFW.
Clik here to view.

Normalizing the EOL Character in Java

1. Introduction Different operating systems use different end-of-line (EOL) characters, which might lead to problems when files are transferred or processed between systems. Besides, normalizing EOL...

View Article


Image may be NSFW.
Clik here to view.

Converting UTF-8 to ISO-8859-1 in Java

1. Introduction The issue of character encoding is of vital importance for Java programming when working with several systems and data sources. In this tutorial, we’ll discuss how to convert UTF-8...

View Article

Image may be NSFW.
Clik here to view.

When to Use Setter Methods or Constructors for Setting a Variable’s Value in...

1. Introduction One of the choices that developers encounter is whether setter methods or constructors should be used to set the value of a variable. Both techniques have their benefits, however they...

View Article

Image may be NSFW.
Clik here to view.

Get List of Entity From Database in Hibernate

1. Introduction Hibernate is a powerful ORM (Object-Relational Mapping) framework that simplifies the interaction between Java objects and relational databases. Hibernate abstracts away the...

View Article


Image may be NSFW.
Clik here to view.

Java InputStream vs. InputStreamReader

1. Overview In this article, we’ll discuss the InputStream class and how it can handle binary information from various sources. We’ll also discuss the InputStreamReader class and its differences...

View Article

Image may be NSFW.
Clik here to view.

Create Spring Prototype Scope Bean with Runtime Arguments

1. Overview In this quick article, we’re going to learn about creating a prototype-scoped bean with runtime arguments in Spring. In Spring, there are many different bean scopes, but the default scope...

View Article

Image may be NSFW.
Clik here to view.

Saga Pattern in Microservices Architecture

1. Introduction In a typical microservice-based architecture, where a single business use case spans multiple microservices, each service has its own local datastore and localized transaction. When it...

View Article


Image may be NSFW.
Clik here to view.

Java Arrays Tutorial

       

View Article


Image may be NSFW.
Clik here to view.

Fix Ambiguous Method Call Error in Mockito

1. Overview In this tutorial, we’ll see how to avoid ambiguous method calls in the specific context of the Mockito framework. In Java, method overloading allows a class to have multiple methods with...

View Article

Image may be NSFW.
Clik here to view.

Include null Value in JSON Serialization

1. Introduction When we work with Java objects and need to convert them into JSON format, it’s crucial to handle null values appropriately. Omitting null values from the JSON output might not align...

View Article

Image may be NSFW.
Clik here to view.

@Subselect Annotation in Hibernate

1. Introduction In this tutorial, we’ll review the @Subselet annotation in Hibernate, how to use it, and its benefits. We’ll also see Hibernate’s constraints on entities annotated as @Subselect and...

View Article

Image may be NSFW.
Clik here to view.

Java Weekly, Issue 535 – Out with the RestTemplate (again)

1. Spring and Java >> Java 22 Delivers Foreign Memory & Memory API, Unnamed Variables & Patterns, and Return of JavaOne [infoq.com] Last week, we celebrated the release of Java 22, but...

View Article


Image may be NSFW.
Clik here to view.

Find Map Keys with Duplicate Values in Java

1. Overview Map is an efficient structure for key-value storage and retrieval. In this tutorial, we’ll explore different approaches to finding map keys with duplicate values in a Set. In other words,...

View Article

Image may be NSFW.
Clik here to view.

Merge Overlapping Intervals in a Java Collection

1. Overview In this tutorial, we’ll look at taking a Collection of intervals and merging any that overlap. 2. Understanding the Problem First, let’s define what an interval is. We’ll describe it as a...

View Article


Image may be NSFW.
Clik here to view.

Finding Element by Attribute in Selenium

1. Introduction Selenium offers plenty of methods to locate elements on a webpage, and we often need to find an element based on its attribute. Attributes are additional pieces of information that can...

View Article

Image may be NSFW.
Clik here to view.

The @Struct Annotation Type in Hibernate – Structured User-Defined Types

1. Overview In this tutorial, we’ll review Hibernate’s @Struct annotation which let’s developers create structured user-defined types. Support for structured user-defined types, a.k.a structured types,...

View Article


Image may be NSFW.
Clik here to view.

Get Last n Characters From a String

1. Overview In this tutorial, we’ll explore a few different ways to get the last n characters from a String. Let’s pretend that we have the following String whose value represents a date: String s =...

View Article

Image may be NSFW.
Clik here to view.

Logging in Spring Boot With Loki

1. Introduction Grafana Labs developed Loki, an open-source log aggregation system inspired by Prometheus. Its purpose is to store and index log data, facilitating efficient querying and analysis of...

View Article

Image may be NSFW.
Clik here to view.

Check if an Element Is Present in a Set in Java

1. Overview In this short tutorial, we’ll cast light on how to check if an element is present in a Set in Java. First, we’ll kick things off by exploring solutions using core JDK. Then, we’ll elucidate...

View Article
Browsing all 3590 articles
Browse latest View live


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