Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
Java
9.4K+ articles
Misc
7.7K+ articles
Java-Functions
4.2K+ articles
Java - util package
1.6K+ articles
Java Programs
1.5K+ articles
java-stream
142+ articles
Java 8
132+ articles
Java-Library
71+ articles
Java-Stream-Collectors
15+ articles
Java-Collectors
19 posts
Recent Articles
Popular Articles
next() Method in Java Collections
Last Updated: 28 October 2025
The Iterator and ListIterator interfaces provide the next method. It is used to retrieve the next element in a collection while traversing through it. It returns the next ...
read more
Java
Java-Iterator
Java-Collectors
Cursor in Java
Last Updated: 27 October 2025
A Java Cursor is an object that is used to iterate, traverse, or retrieve a Collection or Stream object’s elements one by one.Cursors allow sequential access to each eleme...
read more
Java
Java-Collectors
How to Build a Custom Collector in Java?
Last Updated: 03 December 2021
Java Collector is the utility class that provides many helpful methods and functions for the collector interface. Mainly collector implementation is used with the stream c...
read more
Java
Picked
Java-Collectors
How to convert a Stream into a Map in Java
Last Updated: 15 July 2025
Introduced in Java 8, the Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to p...
read more
Java
Java Programs
java-stream
java-map
Java-Stream-Collectors
Java 8
Java-Collectors
Java Collectors
Last Updated: 04 December 2025
In Java, the Stream API provides a modern way to process data. But after filtering, mapping and transforming, we usually need to gather results into a collection, a map or...
read more
Java
Write From Home
Java-Collectors
How to find duplicate elements in a Stream in Java
Last Updated: 12 July 2025
Given a stream containing some elements, the task is to find the duplicate elements in this stream in Java.Examples:Input: Stream = {5, 13, 4, 21, 13, 27, 2, 59, 59, 34}Ou...
read more
Java
Java Programs
java-stream
Java-Collectors
Java-Stream-programs
Java-Collections-Class
Collectors collectingAndThen() method in Java with Examples
Last Updated: 16 June 2022
The collectingAndThen(Collector downstream, Function finisher) method of class collectors in Java, which adopts Collector so that we can perform an additional finishing tr...
read more
Java
Java - util package
Java-Functions
Java-Stream-Collectors
Java-Collectors
Collectors toMap() method in Java with Examples
Last Updated: 26 December 2025
Collectors.toMap() method is used with Java Streams to convert stream elements into a Map. It creates map keys and values by applying the given functions to each element o...
read more
Java
Picked
Java - util package
java-basics
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Collectors partitioningBy() method in Java
Last Updated: 06 December 2018
Collectors partitioningBy() method is a predefined method of java.util.stream.Collectors class which is used to partition a stream of objects(or a set of elements) based o...
read more
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java 8
Java-Collectors
Collectors toList() method in Java with Examples
Last Updated: 25 July 2024
The toList() method of Collectors Class is a static (class) method. It returns a Collector Interface that gathers the input data onto a new list. This method never guarant...
read more
Java
Technical Scripter
Java-Collections
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Java Stream | Collectors toCollection() in Java
Last Updated: 06 December 2018
Collectors toCollection(SupplierC collectionFactory) method in Java is used to create a Collection using Collector. It returns a Collector that accumulates the input eleme...
read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Collectors toSet() in Java with Examples
Last Updated: 06 December 2018
Collectors toSet() returns a Collector that accumulates the input elements into a new Set. There are no guarantees on the type, mutability, serializability, or thread-safe...
read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Java | Collectors minBy(Comparator comparator) with Examples
Last Updated: 06 December 2018
Collectors minBy(Comparator? super T comparator) is used to find an element according to the comparator passed as the parameter. It returns a Collector that produces the m...
read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Java | Collectors averagingLong (ToLongFunction mapper) with Examples
Last Updated: 11 July 2025
Collectors averagingLong(ToLongFunction? super T mapper) method is used to find the mean of the long values passed in the parameters. This method returns a Collector that ...
read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
Java | Collectors averagingDouble() with Examples
Last Updated: 11 July 2025
Collectors averagingDouble(ToDoubleFunction? super T mapper) method is used to find the mean of the double values passed in the parameters. This method returns a Collector...
read more
Misc
Java
Java - util package
Java-Functions
java-stream
Java-Stream-Collectors
Java-Collectors
1
2