Recent Posts

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 […]


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 […]


Copy Streams In Java 9 With The InputStream.transferTo() Method

1. Overview This quick tutorial is going to cover how to use the InputStream.transferTo(), a new method that has been added to the InputStream class from Java 9,  to copy data from input streams to output streams in Java. 2. The InputStream.transferTo(OutputStream) Method Firstly, let’s take a look at the syntax of the InputStream.transferTo(OutputStream) method […]

1 comment

Private Interface Methods In Java 9

This quick tutorial is going to cover about private interface methods in Java 9. 1. Overview As you may know, from Java 8, interfaces can have default methods which enable us to add new functionality to the interfaces of our libraries without breaking all classes that implement those changed interfaces, and therefore ensure binary compatibility with […]


Set Up Eclipse, IntelliJ And NetBeans For Java 9

This tutorial is going to cover how to set up Eclipse, IntelliJ and NetBeans for Java 9 which has been released. 1. Prerequisites Java 9 is installed in your environment. You can download it from the official website or follow instructions from below tutorials to install it. Install Oracle Java 9 on CentOS, RHEL 7 […]