Home » Tag Archives: Java 8

Tag Archives: Java 8

Java 8 Functional Interfaces Introduction Example

Hello readers! In this tutorial, we will learn the amazing feature of Java 8 Functional Interfaces. 1. Introduction To achieve the benefits of functional programming in Java, JDK developers introduced Functional Interfaces/Single Abstract Method (SAM) Interfaces in Java 8 programming. A functional interface is an interface that has only one abstract method A functional interface can have multiple default and ...

Read More »

Java 8 Lambda Expressions Introduction Example

Hello readers! In this tutorial, we feature a comprehensive article on Java 8 Lambda Expressions.  1. Introduction To achieve the benefits of functional programming in Java, JDK developers introduced Lambda Expressions in Java 8 programming. A lambda expression is a nameless function which does not have the name, return type, and access modifiers A lambda expression instance can be assigned ...

Read More »

Java 8 Optional In Depth Example

1. Introduction This is an in-depth article about Java 8 Optional. A new class Optional was introduced in Java 8. The optional class is part of java.util package. Optional is used to represent a value. It can be present or absent. No more null checks and NullPointerException are needed. Optional helps in avoiding any runtime NullPointerExceptions. It helps in developing clean ...

Read More »

Java 8 Functional Programming Tutorial

Java 8 supports functional programming via the lambda expression and Stream API. In this tutorial, I will demonstrate how Java 8 supports functional programming via common pre-defined functional interfaces, Collections, and Stream API.                 Table Of Contents 1. Introduction 2. Technologies Used 2.1 Maven Project 3. Java 8 Predefined Functional Interfaces 3.1 Function ...

Read More »

Java 8 Convert a primitive Array to List Example

In this article we will learn how to Convert a primitive Array to List using Java 8. For this example we will use IDEA IntelliJ but you can also use any IDE. 1. Introduction An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the ...

Read More »

Java 8 Period and Duration Example

In this article we will learn about the Duration and Period classes in Java. These classes were added in Java 8. 1. Introduction A Duration measures an amount of time using time-based values (seconds, nanoseconds). A Period uses date-based values (years, months, days). Duration public final class Duration extends Object implements TemporalAmount, Comparable<Duration>, Serializable   A Duration represents a time-based ...

Read More »

Java MongoDB Update Document Example

Hello readers, in this tutorial we will show how to update the documents of a Mongo collection using the Java driver. 1. Introduction If you have installed the MongoDB application (version 3.6.X) on Windows or Ubuntu operating system and you wish to learn this tutorial, then follow the below steps. It is very simple, but before moving further let’s take ...

Read More »

Java MongoDB Insert a Document Example

Hello readers, in this tutorial, you will learn how to insert the documents into a Mongo collection using the Java driver. 1. Introduction If you have installed the MongoDB application (version 3.6.X) on Windows or Ubuntu operating system and you wish to learn this tutorial, then follow the below steps. It is very simple, but before moving further let’s take ...

Read More »

Java MongoDB Query Document Example

Hello readers, in this tutorial, we will show how to query the documents of a Mongo collection using the Java driver. 1. Introduction If you have installed the MongoDB application (version 3.6.X) on Windows or Ubuntu operating system and you wish to learn this tutorial, then follow the below steps. It is very simple, but before moving further let’s take ...

Read More »

Spring and Hibernate Example

Welcome readers, in this tutorial, we will create a simple application that uses the spring and Hibernate framework to display the user details on a webpage. For this tutorial, we’ll have a welcome page that fetches the user records from the MySQL database and displays it on the interface. 1. Introduction Developers can refer to this link to briefly understand the Spring, ...

Read More »