Talking about volatile variable in Java

The volatile variable in Java has the effect of informing the change of its value to different threads if the variable is being used in multiple threads. For you to understand more, I made an example as follows:

In this example, we have two… Read More

Type Inference in Java

Type Inference in Java is a Java Compiler’s ability base on the declaration, the calling to determine the datatype, without explicitly declaring it, reducing redundancy code. For you to understand more, I will take an example as follows. Assuming you are working with the List… Read More

Static keyword in Java

In Java, variables, which are declared with the static keyword, belong to the class, not to the instance of the class. This means that we do not need to initialize objects to use variables that are declared with the static keyword in those classes. For… Read More

Learn about Predicate Functional Interface in Java

The Predicate interface is used primarily to filter a Stream object. Using the filter() method with the Predicate interface parameter will allow us to filter the items in the Stream object to satisfy some conditions. The content of this interface is as follows:

As… Read More

Learn about Function Functional Interface in Java

Function interface is used to convert data from input parameters to return results in a different format. To do this, we will implement the apply() abstract method defined in the Function interface. But first, let’s look at the contents of the Function interface.

We… Read More