Java CompletableFuture API Improvements

The CompletableFuture in java was introduced in java 8. It is the enhanced version of the Future interface.  Java 9 provides some more functions to improve it and solve problems raised in Java SE 8. Java 9 provides methods for delays and timeouts, some utility methods, and better sub-classing. It Java completablefuture added 8 new … Read more

try with resource improvement

Java try with resource was a great feature and was first introduced in Java 7. This helps to manage the resource and close them automatically when they are no longer in use. Java 9, making some enhancement in try with resource, So that it will be more readable. In this post, we will see how it … Read more

Java 9 module

Java 9 modules are a major change in the structure of java, and it is the biggest feature of Java 9. You must think about why we are saying changes in the structure of java because in this feature java collects packages and code into a single unit that is known as java modules. In … Read more

Optional Class Improvements

Java optional class was introduced in java 8 to avoid the NullPointerException exception. As we know, every developer faces the NullPointerException in daily coding. Before java 8, developers place the null checks on every place, but since Java 8, providing the optional class to remove it. Java 9 introduced some new methods to Optional Class … Read more

Private methods in interface

In java, Interface is part of abstraction in java and it is one of the strong pillars of OOP. We have already covered a lot of things about Interface in a recent post. Java 8 allows defining default and static methods in the interface. If you want to know, why the default method was introduced … Read more

Factory Methods for Immutable List, Set, Map and Map.Entry

Java 9 introduced a new way to create immutable collections in java. If you are a beginner then you should read about immutable collection in java(Immutable list, immutable set etc). Java 9 provides Factory methods to create Immutable List, Set, Map and Map.Entry objects. These methods are known as utility methods in java and are … Read more

CompletableFuture in java

Java 8 has made some major changes and provides major functionality like lambda expression and Stream API in Java 8. The CompletableFuture in Java was also introduced in Java 8 to support asynchronous programming. CompletableFuture is an extension of Future’s API. If you are not familiar with Future interface in java then read it first. Here we will … Read more

Callable and Future in java

To create a thread in java we have two ways, one is the Runnable interface, and another is Thread class. The Runnable interface has some limitations in a multithreading environment. So, Java introduced Callable and Future interfaces to remove the limitations. In this topic, we will learn these advanced topics of concurrency in java and show how these are useful. We … Read more

Date and time java 8 API

There are several applications that are using date in java and time in java. But before java 8 date and time are very confusing topics with serval problems. Java 8 introduced a new feature that is known as date and time java 8 API.  In this post, we will see what the new features are … Read more

Java try with resource

When we develop an application or project, we use many resources to achieve the task. All the resources must be closed after the program is finished using it. A resource is just an object that we used to perform operations. But sometimes we forget to close the resource after completion of execution and that leads … Read more