Learn about Supplier Functional Interface in Java

Supplier is a Functional Interface, so it only contains an abstract method as follows:

This interface simply returns the value in the context that is being used by the get() method. For example, we have the following list:

Now that I want to… Read More

Learn about Consumer Functional Interface in Java

Java 8 introduces a new package containing Functional Interfaces called java.util.function. In this package, we have many interfaces like Consumer, Supplier, Predicate, … In this tutorial, we will learn about Consumer Functional Interface. The content of this interface is as follows:

Because the Consumer… Read More

Basic about JDBC

JDBC stands for Java Database Connectivity, which is an API that allows us to build applications that can access and manipulate with many different types of databases. In this tutorial, I will talk to you about the basic knowledge of JDBC. First, I will create… Read More

Move file in Java

To migrate any file in Java, in Java 6 or older Java versions, we can use the renameTo() method located in the File object to do this:

Result:

From Java 7 onwards, we have another way to move a file, which is to… Read More