Java 8

Java: Collectors Class

Mastering Java 8's Collectors Class Introduction Java 8 introduced the Stream API, which revolutionized the way we process collections of data. One of the key components of this API is the Collectors class, which provides various methods to perform reduction operations on stream…

Java 8 IntStream Examples

In Java, `IntStream` is a part of the java.util.stream package and represents a stream of primitive integers. It's designed to work with the functional programming features introduced in Java 8, allowing you to perform aggregate operations on sequences of elements. Here are some examples of …

Introduction To Functional Interface

Functional interfaces are a key feature introduced in Java 8 to support functional programming concepts. A functional interface is an interface that has exactly one abstract method. It serves as a contract for lambda expressions and method references, allowing functional-style programming in Java. …

Java 8 parallelStream() vs. stream().parallel()

Introduction: In Java 8, the introduction of the Stream API revolutionized the way developers manipulate and process collections of data. Among its powerful features are the parallelStream() method and the parallel() method on regular streams. These methods enable concurrent processing, unlocking p…

The Power of Java Optional

The Optional class was introduced in Java 8 to handle null values more elegantly. It is a container object which may or may not contain a non-null value. It provides a way to represent null values and also method to handle null values without throwing a NullPointerException. In this post, we will e…

Top 50 Java 8 Interview Questions For Senior Developer

Hi guys, WELCOME TO JAVA INSPIRES. In this post, we will see top 50 java 8 interview questions for senior developers. 1. What is Java 8? Java 8 is a major release of the Java programming language that introduced several new features and enhancements to the platform. 2. What are the new features …

[Java 8 Examples] - Transforming a List

In this post, we will see how to transform a list object into different list using streams from Java 8 and Method references. Example #1: Convert all names to Upper case names in a List package java8examples; import java.util.ArrayList; import java.util.List; import java.util.stream.Collect…

How to Convert java.util.Date to java.time.LocalDate

Hi Guys, Welcome to Java Inspires. In this post, we will see the program how to convert java.util.Date object to java.time.LocalDate. Java8Example.java package com . javainspires . java8example ; import java.time.LocalDate ; import java.time.ZoneId ; import java.util.Date ; /** * *…

How to get Common elements from two lists using Stream API filter()

#JavaInspires  Hi Guys, Welcome to Java Inspires. In this post, we will see How to get Common elements from two lists using  Stream API filter(). Here, we will create two string lists with some common elements and will get common elements list by using filter method from stream api. Java8Exa…

Java 8 Streams filter() - Simple Example

#JavaInspires 😀 Hi Guys, Welcome to Java Inspires. In this example, we will see how to use filter method from Java 8 streams. Here, we will create a employee list and filter the same with employee age greaterthan 30. Java8Example.java package com . java inspires . java8example ; import java.…

Load More
That is All