Print Even and Odd Numbers Using 2 Threads
1. Introduction In this tutorial, we’re going to have a look at how we can print even and odd numbers using two threads. The goal is to print the numbers in order, while one thread only prints the...
View ArticleMocking a RestTemplate in Spring
1. Introduction Frequently, we find ourselves with applications which perform some sort of web request. When it comes to testing this behavior, we have a few options with Spring apps. In this quick...
View ArticleArray Operations in Java
1. Overview Any Java developer knows that producing a clean, efficient solution when working with array operations isn’t always easy to achieve. Still, they’re a central piece in the Java ecosystem –...
View ArticleSSL Handshake Failures
1. Overview Secured Socket Layer (SSL) is a cryptographic protocol which provides security in communication over the network. In this tutorial, we’ll discuss various scenarios that can result in an...
View ArticleSpring Null-Safety Annotations
1. Overview Starting with Spring 5, we now have access to an interesting feature helping us write safer code. This feature is called null-safety, a group of annotations working like a safeguard that...
View ArticleSpring Security OAuth Login with WebFlux
1. Overview Spring Security added OAuth support for WebFlux starting with the 5.1.x GA. We’ll discuss how to configure our WebFlux application to use OAuth2 Login support. We’ll also discuss how to...
View ArticleGuide to BufferedReader
1. Overview BufferedReader is a class which simplifies reading text from a character input stream. It buffers the characters in order to enable efficient reading of text data. In this tutorial, we’re...
View ArticleConvert Latitude and Longitude to a 2D Point in Java
1. Overview When implementing applications that use maps, we will typically run into the problem of coordinate conversion. Most of the time, we need to convert latitude and longitude to a 2D point to...
View ArticleGenerate a Secure Random Password in Java
1. Introduction In this tutorial, we’ll look at various methods we can use to generate a secure random password in Java. In our examples, we’ll be generating ten-character passwords, each with a...
View ArticleInstalling Java on Ubuntu
1. Overview In this tutorial, we’ll introduce different methods for installing a JDK on Ubuntu. Then, we’ll briefly compare the methods. Finally, we’ll show how to manage multiple Java installations...
View ArticleWorking with Dates in Kotlin
1. Introduction In this quick tutorial, we’ll learn about working with dates in Kotlin. We’ll be looking into Date-related operations such as creating, formatting and manipulating dates. 2. Creating...
View ArticleDeep Dive Into the New Java JIT Compiler – Graal
1. Overview In this tutorial, we’ll take a deeper look at the new Java Just-In-Time (JIT) compiler, called Graal. We’ll see what the project Graal is and describe one of its parts, a high-performance...
View ArticleHow to Replace Many if Statements in Java
1. Overview Decision constructs are a vital part of any programming language. But we land up in coding a huge number of nested if statements which make our code more complex and difficult to maintain....
View ArticleJava Weekly, Issue 254
Here we go… 1. Spring and Java >> Faster Development with Spring Boot DevTools [vojtechruzicka.com] With time-saving features like automatic restart and live reload, this is a really good tool...
View ArticleLimiting Query Results with JPA and Spring Data JPA
1. Introduction In this tutorial, we’re going to learn about limiting query results with JPA and Spring Data JPA. First, we’ll take a look at the table we want to query as well as the SQL query we...
View ArticleZonedDateTime with Spring Data MongoDB
1. Overview Spring Data MongoDB module improves readability and usability when interacting with a MongoDB database in Spring projects. In this tutorial, we’ll focus on how to handle the ZonedDateTime...
View ArticleCalculate the Area of a Circle in Java
1. Overview In this quick tutorial, we’ll illustrate how to calculate the area of a circle in Java. We’ll be using the well-known math formula: r^2 * PI. 2. A Circle Area Calculation Method Let’s...
View ArticleIntersection Between two Integer Arrays
1. Overview In this quick tutorial, we’ll have a look at how to compute the intersection between two Integer arrays ‘a’ and ‘b’. We’ll also focus on how to handle duplicate entries. For the...
View ArticlePersisting DDD Aggregates
1. Overview In this tutorial, we’ll explore the possibilities of persisting DDD Aggregates using different technologies. 2. Introduction to Aggregates An aggregate is a group of business objects which...
View ArticleMockito Tutorial
I just announced the new Spring Boot 2 material, coming in REST With Spring: >> CHECK OUT THE COURSE This tutorial series focuses on the Mockito library - from basic to more advanced use cases,...
View Article