Home » Java 8 » Page 3

Tag Archives: Java 8

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 »

Java MongoDB Authentication Example

Hello readers. In this tutorial we will show how to start the Mongo database in secure mode and use the Java driver to connect and authenticate the Mongo database with the provided credentials. 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 ...

Read More »

Java 8 Convert a String to LocalDate Example

Hello readers, in this tutorial, we will learn how to convert a given response string into a java.time.LocalDate object. 1. Introduction These days in the programming universe Date and Time handling are the most time-consuming tasks in Java. In the ancient Java world, developers were dependent on the complex SimpleDateFormat class to convert and format the Date strings into the ...

Read More »

Java 8 Filter Null Values from a Stream Example

Hello readers, in this tutorial, we will learn how to filter the null elements from a Stream in Java. 1. Introduction Java Stream is a sequence of elements that support the sum operations. In streams, the elements are reckoned on demand from different data sources such as Collections, Arrays or I/O resources and thus the elements are never stored. Streams ...

Read More »