Home » Java 8

Tag Archives: Java 8

Migrating from Java 8 to Java 13

In this article, we will demonstrate how to migrate an application from Java SE 8 to Java SE 13. 1. Introduction Oracle began a six-month release cadence for Java Standard Edition starting with Java 10. Instead of being major version releases, they are instead “feature releases”. This release cycle is in the spirit of Continuous Integration / Continuous Deployment and ...

Read More »

Overloading Java Methods Example

In this post, we feature a comprehensive article on Overloading Java Methods. Overloaded methods are methods with the same name signature but either a different number of parameters or different types in the parameter list. It is similar to constructor overloading, that allows a class to have more than one constructor having different argument lists. Method overloading is an example ...

Read More »

Printstream Java Example

This article is a quick introduction to the Printstream Java class available as part of Java ecosystem. 1. Introduction Stream refers to data essentially bytes at lowest level. To read and process data from a source, the data needs to be saved. Outputstream is the means to save the data to a sink. Outputstream is the superclass of all classes ...

Read More »

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 »