Java Stream collect() operation with examples

Welcome to Java 8 series. In this tutorial, you will learn about java stream collect() operation with examples. Stream collect() is a reduction operation performed on the stream of elements. It applies a certain function on the stream of elements to generate the final output. Stream collect() is mainly used for, converting the stream of elements into a collection interface such as […]

How to use Scala Stack collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala Stack collection and I have explained most of the Stack operations with examples. A stack is based on the Last-In-First-Out algorithm(LIFO) and it is one of the basic collections being used in any programming language. Scala does support Stack out of the box. Some of the real-world […]

How to use Collectors averagingDouble()/averagingInt/averagingLong in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors averagingDouble()/averagingInt/averagingLong in Java 8 If you would like to learn about Java 8 Stream operations. Please check out this link. Collectors.averagingDouble()/averagingInt/averagingLong in Java 8 is mainly used to identify mean of the stream of elements. If there is scenario or use case to find the […]

How to use Collectors.summarizingDouble() in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.summarizingDouble() in Java 8 If you would like to learn about Java 8 Stream operations. Please check out this link. Collectors.summarizingDouble() Collectors.summarizingDouble() in Java 8 is a useful and wonderful operation of Stream collect(). It provides us the statistics of the stream of elements. It returns […]

How to use Collectors.summarizingLong() in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.summarizingLong() in Java 8 If you would like to learn about Java 8 Stream operations. Please check out this link. Collectors.summarizingLong() Collectors.summarizingLong() in Java 8 is a useful and wonderful operation of Stream collect(). It provides us the statistics of the stream of elements. It returns […]

How to use Collectors.summarizingInt() in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.summarizingInt() in Java 8 If you would like to learn about Java 8 Stream operations.Please check out this link. Collectors.summarizingInt() Collectors.summarizingInt() in Java 8 is a useful and wonderful operation of Stream collect().It provides us the statistics of the stream of elements. It returns a class […]

Collectors.summingInt()/summingLong()/summingDouble()

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.summingInt()/summingLong()/summingDouble()  in Java 8. If you would like to learn about Java 8 Stream operations.Please check out this link. Collectors.summingInt()/summingLong()/summingDouble()  is used in Java 8 streams to sum the elements of the Stream into a single value. Each operation produces the sum value of the stream […]

How to use Collectors.counting() in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.counting() in Java 8. If you would like to learn about Java 8 Stream operations.Please check out this link. Collectors.counting() in Java 8 allows us to count the number of elements in the stream and provide the output as Long. Collectors.counting() Syntax public static <T> Collector<T,?,Long> […]

How to use Collectors.toCollection in Java 8

Welcome to Java 8 series. In this tutorial, you will learn about how to use Collectors.toCollection in Java 8. If you would like to learn about Java 8 Stream operations.Please check out this link. Collectors.toCollection in Java 8 is used in Stream concepts to collect the stream of elements in a collection and collection should be of type  java.util.Collection. We can […]

How to use Scala Queue collection

Welcome to Scala series. In this tutorial, you will learn How to use Scala Queue collection and I have explained most of the Queue operations with examples. Queue is one of the basic and important data structures of any programming language. Scala does support Queue. Queue is part of the Scala collection package and it is based on IndexedSeq. What is […]