Java 9 features

After the Java 8 release, Java 9 features release some major changes and improve many things. The biggest change is modular JDK in Java 9. In this post, we will see all Java 9 features.

Java 9 features

Java 9 immutable collections improvement

Java 9 provides factory methods to create an immutable collection in java. These Factory Methods are used to create the Immutable List, Set, Map, and Map.Entry.  We will cover it in detail.

Private methods in Interfaces

Java 8 has provided the default and static methods in java. But Java 9 introduced a private method in the interface. In the next post, we will see what is the need for a private method?

Let’s read it in detail.

Java 9 Module System

In every release of Java, JDK size increases that create problems for small devices. Java 9 decides to break this JDK into different modules. Java 9 provides the module system and here almost 95 modules.

Let’s read the modular java system in detail.

 

Try with resource improvement

Try with resource was introduced in java 7. But there was some problem in try with resources. To resolve the problem, java 9 provides some improvements. We will cover it in a separate section.

Let’s read it from here.

CompletableFuture API Improvements:

The CompletableFuture class introduced in java 9 to provide some improvement to Future interface. The Future interface is used to hold the object that comes from callable. But there were some limitations.

We will cover it in separate post.

Optional class improvement

The optional class was introduced in java 8 to resolve the NullPointerException. Every java program faces the NullPointerException. Java 8 provides a way to ignore but java 9 provides some method to enhance the functionality.

Let’s read it in detail.

JShell

The JShell stands for Java Shell and it is used to execute and test the java code.  It is also known as REPL in java. Before java 9, we create a complete java program to start the programming in java, but Java 9 provides a tool JShell that provides the environment to run java code directly. We don’t need to write the complete code for logic.

We can read it in detail.

 

2 thoughts on “Java 9 features”

  1. Hi Java goal team small correction
    Private methods in Interfaces topic :
    Java 8 has provided the default and static methods in java.

    Thanks & Regards
    s.srinivas

    Reply

Leave a Comment