
How to Get the Last Element of a Stream in Java?
1. Overview The Java Stream API was the major feature of the Java 8 release. Streams represent lazily-evaluated sequences of objects and provide a rich, fluent, and monadic-like API. […]
1. Overview The Java Stream API was the major feature of the Java 8 release. Streams represent lazily-evaluated sequences of objects and provide a rich, fluent, and monadic-like API. […]
1. Overview In this short tutorial, let’s convert a Java Iterable object into a Stream and perform some standard operations on it. 2. Converting Iterable to Stream The Iterable interface is designed keeping generality […]
1. Overview Java 8 has introduced a new Stream API that lets us process data in a declarative manner. In this quick article, we would learn how […]
1. Overview In this quick article, we explain different ways of merging Java Streams – which is not a very intuitive operation. 2. Using Plain Java The […]
1. Overview Java 8 introduced the concept of Streams as an efficient way of carrying out bulk operations on data. And parallel Streams can be obtained in environments […]
1. Introduction In this article, we’re going to talk about how to filter out non-empty values from a Stream of Optionals. We’ll be looking at three different approaches […]
1. Overview As Java developers, we often write code that iterates over a set of elements and performs an operation on each one. The Java 8 […]
1. Overview In this quick tutorial, we’re going to talk about the toMap() method of the Collectors class. We’ll use it to collect Streams into a Map instance. For all the examples […]
1. Overview Collectors were added in Java 8 which helped accumulate input elements into mutable containers such as Map, List, and Set. In this article, we’re going to explore two […]
1. Introduction In this tutorial, we’ll see how the groupingBy collector works using various examples. For us to understand the material covered in this tutorial, we’ll need a […]
1. Overview In this tutorial, we will be going through Java 8’s Collectors, which are used at the final step of processing a Stream. If you […]
1. Introduction This tutorial is a guide to different functional interfaces present in Java 8, as well as their general use cases, and usage in […]
1. Overview The Java 8 Stream API introduced two methods that are often misunderstood: findAny() and findFirst(). In this quick tutorial, we’ll look at the difference between these two methods […]
1. Overview In this article, we’ll have a quick look at one of the major pieces of new functionality Java 8 had added – Streams. […]
1. Overview In this comprehensive tutorial, we’ll go through the practical uses of Java 8 Streams from creation to parallel execution. To understand this material, […]
1. Introduction In this tutorial, we’ll cover the implementation of a binary tree in Java. For the sake of this tutorial, we’ll use a sorted binary tree that […]
1. Overview In this quick tutorial, we’re going to talk about four different ways to remove items from Java Collections that match certain predicates. We’ll naturally also look […]
1. Overview In this quick tutorial, we’ll learn about the various ways in which we can get the size of an Iterable in Java. 2. Iterable and […]
1. Introduction An Iterator is one of many ways we can traverse a collection, and as every option, it has its pros and cons. It was first […]
1. Introduction Java Collections is a topic often brought up on technical interviews for Java developers. This article reviews some important questions that are asked […]