Recent Posts

Reactive HTTP Client With Spring 5 WebClient

This article is going to cover about Spring 5 WebClient, a non-blocking, reactive client for HTTP requests with Reactive Streams back pressure. 1. Introduction To Spring 5 WebClient The WebClient is a non-blocking, reactive HTTP client which has been introduced in Spring 5 and is included in the spring-webflux module. Following are characteristics of the […]


Java 9 – Effectively Final Variables In try-with-resources

In this tutorial, we’re going to get through how to use effectively final variables in the try-with-resources statement in Java 9. 1. The try-with-resources Statement In Java The try-with-resources statement is a try statement that declares one or more resource and ensures that each resource will be closed at the end of the statement. Any […]


Java 9 HTTP/2 Client API Example

1. Overview This tutorial is going to cover Java 9 HTTP/2 Client API. We’ll get through how to create a HttpClient object, make HTTP requests and handle HTTP Responses. Notice that the HTTP/2 Client API is an incubator module named jdk.incubator.httpclient which has been introduced in Java 9. And as mentioned in the link, because […]


How To Compare Arrays In Java 9

In this tutorial, we’re going to get through new methods that have been added to the java.util.Arrays class since Java 9, which enables us to compare arrays and¬†slices of arrays in Java efficiently. 1. Compare Arrays Equality In Java 9 Firstly, let’s take a look at the Arrays.equals methods, which were existed since prior versions […]


Streams API Updates In Java 9

In this tutorial, we’re going to take a first look at the streams API updates in Java 9, which includes new stream operations: dropWhile, takeWhile, iterate and ofNullable. 1. The dropWhile() Method Firstly, let’s take a look at the syntax of the dropWhile() method:

Parameters: predicate – a non-interfering, stateless predicate to apply to […]

1 comment

Java 9 – New Methods Of The Optional Class

This tutorial is going to cover about new methods of the Optional<T> class in Java 9. We’re going to get through 3 methods which recently added, have the syntax as follows: void ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction) Optional<T> or(Supplier<? extends Optional<? extends T>> supplier) Stream<T> stream() For more detail about the Optional<T> class, please […]


Java 9 JShell Cheat Sheet

This tutorial is going provide a quick reference for commands that will frequently encounter when we work with JShell in Java 9. Hopefully, this will be a useful Java 9 JShell cheat sheet. 1. What Is JShell The JShell tool is a command line tool that provides interactive use of Java Programming Language elements. JShell […]